FAQ: Manage Office 365 with PowerShell
Get started managing Office 365 with PowerShell.
John Savill
May 24, 2014
1 Min Read
Q: How can I manage my Office 365 subscription using PowerShell?
A: Several options exist for integrating Office 365 with PowerShell. The easiest approach is to create a PowerShell session to the Office 365 service, which then has all the required PowerShell modules available without you needing to install anything locally. The following PowerShell code will trigger an authentication window for your Office 365 credentials, establishing a session to Office 365 where you can run your commands.
$UserCredential = Get-Credential$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirectionImport-PSSession $Session#Run you commands here, for exampleGet-accepteddomain | ft DomainName, DomainType, Default, PendingRemoval -AutoSize#Close the sessionRemove-PSSession $Session
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like