Friday, December 6, 2013

Get SharePoint Server Details (Server Name, IP, Role, Status, etc) in the Farm using PowerShell

Requirement: Quickly retrieve and document details all server in the SharePoint Server farm.

Solution:
To get all Servers in SharePoint farm, We use: Get-SPServer cmdlet.

Get-SPServer
Lets include Server Name, Role and Status fields
#Get All Servers in SharePoint Farm (including SQL Server, SMTP Server, Etc)
Get-SPServer | select Name, Role, Status | Format-table -AutoSize
The above cmdlet retrieves all servers in the SharePoint farm including SQL Server, SMTP Server, etc.  To get only SharePoint Servers we can use:
#Get all SharePoint Servers
$servers = Get-SPServer | where { $_.role -ne "Invalid"}
Lets add one more parameter: IP Address to it.
#Get all SharePoint Servers
$servers = Get-SPServer | where { $_.role -ne "Invalid"}
#Get Server Details including IP
$servers | select Name, Role, @{Label="IP Address";Expression={[System.Net.Dns]::GetHostByName($_.Name).AddressList.IPAddressToString}} | Format-Table



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...