Useful Exchange PowerShell Commands

Return the Current Time & Time Zone for all Exchange Servers in the Organisation:

$ExServers = Get-ExchangeServer
$ExServers | %{
$TimeZone = Get-WmiObject -Class win32_timezone -ComputerName $_
$LocalTime = Get-WmiObject -Class win32_localtime -ComputerName $_
$strOutput = @{‘Computer Name’ = $LocalTime.__SERVER;
‘Time Zone’ = $TimeZone.Caption;
‘Current Time’ = (Get-Date -Day $LocalTime.Day -Month $LocalTime.Month);
}
$Object = New-Object -TypeName PSObject -Property $strOutput
$Object
}

ExServerTime

Advertisements

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s