Script repository
The script updates the time zone of a mailbox in on-premises Exchange. To execute the script, create a business rule, custom command or scheduled task configured for the User object type.
Parameters
$timeZone- the time zone to set for the mailbox.$exchangeServer- the fully-qualified domain name (FQDN) of the Exchange server.
$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
}
Comments 5
You must be signed in to comment.
Josh
Is this still the current best practice to do this in a PS script? Or is there a better way to modify this/these properties for new user provisioning?
Support
Hello Josh,
Using the script is currently the only option to update the time zone of a mailbox via Adaxes.
Josh
Thank you, I just wanted to verify that this was still applicable even though it's from 2019.
Jon
Does this work for Exchange Online/M365, or just Exchange On-prem?
Support
Hello Jon,
This script only works in on-premises Exchange.