RSS

获取组织内所有exchange服务器的版本和rollup状态

30 Nov

输出的状态

$exsrvs = get-exchangeserver | ? {$_.serverrole -notlike "edge"}| sort name
foreach ($exsrv in $exsrvs)
{
$version = (get-exchangeserver -identity $exsrv).admindisplayversion
$edition = (get-exchangeserver -identity $exsrv).edition

write-host "======this is from xunyang@live.com=================="
write-host "Exchange Server: $exsrv"
write-host $version
write-host "Edition: $edition"
write-host "Installed Update Rollups:"
$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(’LocalMachine’, $exsrv)
$regKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\461C2B4266EDEF444B864AD6D9E5B613\Patches\"
$baseKey = $baseKey.OpenSubKey($regKey)
$Updates = $baseKey.GetSubKeyNames()

ForEach($Update in $Updates)
{
$fullPath= $regKey + $Update
$UpdateKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(’LocalMachine’, $exsrv)
$UpdateKey = $UpdateKey.OpenSubKey($fullPath)
$values = $UpdateKey.GetValueNames()
ForEach($value in $values)
{
if ($value -eq "DisplayName")
{Write-host $UpdateKey.GetValue($value)}
}
}
write-host "======this is from xunyang@live.com=================="
}

Advertisements
 
1 Comment

Posted by on November 30, 2009 in Exchange Server

 

One response to “获取组织内所有exchange服务器的版本和rollup状态

  1. November 30, 2009 at 21:40

    太强悍太佩服了,不愧是猫猫哥哥啊,真男人!

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: