Powershell to get the version of Exchange in Office365 you are running on.

Powershell to get the version of Exchange in Office365 you are running on.

This powershell will get the version of Exchange that your Office365 tenant is running on, and pipe it to a file in c:\temp\ExchangeVersion.txt.
If you set a scheduled task to run this nightly it will build up a history of the version numbers in the log file.

$user = "<Office 365 login>"
$password = convertto-securestring "<password>" -asplaintext -force

$cred = New-Object system.management.automation.pscredential $user,$password
Connect-MsolService -Credential $cred
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session

$name= Get-Date
$Name | out-file -append C:\temp\ExchangeVersion.txt

Get-mailbox -identity "<mailbox on Office365>" | Select ExchangeVersion | out-file -append C:\temp\ExchangeVersion.txt
$name= "=================================================="
$Name | out-file -append C:\temp\ExchangeVersion.txt


Remove-PSSession $Session

Comments

Popular posts from this blog

Restore a deleted OneDrive for Business account from Office365: "A site collection with the same Site Id or Path already exists."

Server Manager will not start, error .NET Framework: "This application requires one of the following versions of the .NET Framework:"