I’ve migrated a lot of customers to Office 365. The web-based partner administration for Exchange, Sharepoint and Lync works well, but some things are just easier with with powershell. Here’s how I administer Office 365 instances with custom powershell scripts.
I basically create a separate PS1 file for each office365 instance pre-configured with the admin username. All I have to do to manage that instance is double click a file and enter a password and I’m ready to go. Here’s how:
[step 1] Download and install the Microsoft Online Services Sign-In Assistant BETA.
[step 2] Download and install the Windows Azure Active Directory Module for Windows PowerShell (WAADM).
[step 3] Open an instance of the WAADM PowerShell and set the execution policy to remotesigned by entering the command below and selecting Y for Yes when prompted:
[step 4] Copy and paste the following code into a text editor and save it as InstanceName.ps1:
param ( $Show )
if ( !$Show )
PowerShell -NoExit -File $MyInvocation.MyCommand.Path 1
$user = "office365admin(at)yourdomain.com"
$UserCredential = Get-Credential -Credential $user
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
[step 5] Right-click the PS1 file you created in [step 4] and select Open With… and then select the Windows PowerShell executable in C:WindowsSystem32WindowsPowerShellv1.0powershell.exe and check the box to Always use this application.
[step 7] Duplicate the PS1 scripts so you can have one file for each administrative office365 account username you have and change the following line in each of those files to match your office365 admin user:
$user = “[email protected]”
Now to manage an office365 instance, simply double-click the matching PS1 file, enter the password and start issuing commands. Bam! Done!