The script updates the time zone of a mailbox in on-premise Exchange.
Parameters:
- $timeZone- Specifies the time zone that will be set for the mailbox.
- $exchangeServer - specifies the fully qualified domain name (FQDN) of your Exchange Server
PowerShell
$timeZone = "Pacific Standard Time" # TODO: modify me
$exchangeServer = "ExchangeServer.domain.com" # TODO: modify me
try
{
# Create a remote PowerShell session to the Exchange Server
$session = New-PSSession -configurationname Microsoft.Exchange -connectionURI http://$exchangeServer/PowerShell
Import-PSSession $session -DisableNameChecking -AllowClobber
Set-MailboxRegionalConfiguration -Identity "%objectGUID%" -TimeZone $timeZone
}
finally
{
# Close the remote session and release resources
Remove-PSSession $session
}