Collating SharePoint Server Details

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

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.

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

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 = ""
		" "
		" "
	}

Your ads will be inserted here by

Easy Ads.

Please go to the plugin admin page to set up your ad code.

Leave a Reply

Your email address will not be published. Required fields are marked *