Server Inventory Script

I have been working on a number of projects lately where I need to touch most of the servers in our environment; be it changing DNS servers, or querying event logs, I needed a way to get every live server out there.

The attached script will query AD for all servers, then if pingable, it will attempt to gather more info via WMI. The final result is output to a CSV file in the C:\ root of the local computer.

On servers not running WMI, it will attempt to do a DOS Ping and then run NBTStat to gather the IP and MAC address.

AttachmentSize
GetServerInfo_dyna.vbs_.txt7.38 KB

Quckie - Get Windows Service Pack Level

We had a cluster issue with one of our Exchange 2007 CCR clusters. It didn't successfully failover when the virtual server quit responding. On this, we noticed that this server was still running Windows 2008 SP1.

This quick script exports all the windows versions and service packs for all current Exchange servers in your environment.

$servers = Get-ExchangeServer

$report = @()
foreach ($S in $servers) {
        $colItems = get-wmiobject -class "Win32_OperatingSystem" -namespace "root\CIMV2" -computername $s.Name
        $report += $colItems | select Caption, CSName,CSDVersion
}

$report | Export-Csv -Path ".\serverreport.csv"