Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there a particular configuration file from which the administrative port number of a SharePoint installation can be read from?

What I want is to get the administrative port number of a given SP installation programmtically.

share|improve this question

migrated from stackoverflow.com Oct 10 '11 at 11:16

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 1 down vote accepted

basically their is no configuration file for this you can use stsadm command to get portnumber

stsadm -o getadminport

if you want use it using object model kindly use

SPAdministrationWebApplication details are provide at link below (this will give you url from which you can extract the port number

        SPAdministrationWebApplication caWebApp = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local;
   url = caWebApp.Sites[0].Url;

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spadministrationwebapplication_members.aspx

share|improve this answer
    
Thanks Ashutosh! That is what I was looking for. –  Chamila Oct 18 '11 at 7:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.