Collating SharePoint Server Details

I’m often required to gather details about the underlying SharePoint Farm infrastructure, and with a few WMI queries this can be done in snap.

This script retrieves the CPU cores, physical RAM, disk configuration, NIC configuration and operating system details.

foreach ($server in Get-SPServer) {
		"Server: " + $server.Address
		"--------------------------"
		#TEST WMI CONNECTION
		try {
		#CPU
		$wmi = Get-WmiObject -Class Win32_processor -Computer $server.Address -ErrorAction SilentlyContinue
		"Total Cores: " + $wmi.NumberOfCores
		" "
 
		#RAM
		$wmi = Get-WmiObject -Class Win32_ComputerSystem -Computer $server.Address -ErrorAction SilentlyContinue
		"Total RAM (GB): "  + $wmi.TotalPhysicalMemory/1GB
		" "
 
		#DISKS
		$wmi = Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -Computer $server.Address -ErrorAction SilentlyContinue
		foreach ($drive in $wmi) {
			"Drive: " + $drive.DeviceID
			"Size (GB): " + $drive.Size/1gb
			"Free Space (GB): " + $drive.FreeSpace/1gb
			" "
		}
 
		#NIC
		$wmi = Get-WmiObject -Class Win32_NetworkAdapter -Computer $server.Address -ErrorAction SilentlyContinue
		foreach ($nic in ($wmi | ? {$_.Speed -gt "1"})) {
			"NIC Name: " + $nic.ServiceName
			"NIC Speed (Mbps): " + $nic.speed/1000/1000 # Mbps
			" "
			}
 
		$wmi = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Computer $server.Address -ErrorAction SilentlyContinue
		foreach ($con in ($wmi | ? {$_.IpEnabled -eq $true})) {
			"NIC Name: " + $con.ServiceName
			"IP Address: " + $con.IPAddress
			" "
		}
 
		#OS
		$wim = Get-WMIObject -Class Win32_OperatingSystem -Computer $server.Address -ErrorAction SilentlyContinue
		"Operating System: " + $wim.Caption
		"Operating Service Pack: " + $wim.ServicePackMajorVersion
 
		}
		catch {
			"Could not connect to WMI provider"
			}
		$wmi = ""
		" "
		" "
	}

Check SP Content Databases are configured with Failover Server

Quick one-liner to check all the content databases for SharePoint 2010 are configured properly with the Failover Server property:

Get-SPContentDatabase | Select-Object -Property DisplayName, Server, FailoverServer

Change to GetSPDatabase to get the Failover Property for all SharePoint databases. Click here (technet.microsoft.com) for a great TechNet article explaining which SharePoint 2010 databases support database mirroring.