Tuesday, January 19, 2010

To find the port number of the Central administration using powershell

In Order to find the Central administration port number in MOSS 2007, you can run the below script to get the port number.
----
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint")[Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local.Sites.VirtualServer.Port

-----

In Order to get the same in SP2010, you can run the below powershell script

-----
[Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local.Sites.VirtualServer.Port

----------


Also you can run the below powershell line. this shall give you the web application URLs of all web applications.

Get-SPWebApplication -IncludeCentralAdministration

 
Hope this helps..

1 comment: