Powershell is a great and powerful command line interface (CLI) that can be used to administer Office 365. If you are not already using Powershell to manage your Office 365 online account you are missing out on many features unavailable through the graphical user interface.
Unfortunately, at this time Microsoft does not give out access to the back end management software for Exchange (ESM), or SharePoint (Central Administration). Instead Microsoft provides a stripped down web interface that provides you with the basics. This isn’t really an issue if you use Powershell as Powershell is powerful enough to fill in the gaps in the stripped down GUI. Gaps like, giving editing rights to a shared calendar and many more.
There are a few steps that you will need to take before you can start using Powershell to manage your Office365 domain. Please follow the steps below:
Prerequisite software necessary to manage Office 365 using Powershell
If you’re running Win7 or newer you will have Powershell all ready installed. If not you will need to download and install it.
You can get Powershell 3.0 here: http://www.microsoft.com/en-us/download/details.aspx?id=34595. Warning, if you’re managing Exchange 2010 or earlier on premise with Powershell you will need to use Powershell 2.0.
Microsoft Online Services Sign-in Assistant:
You will need this small piece of software installed to be able to connect to Office365. It is also necessary for running the Lync client on your desktop.
You can download them here:
32 bit – http://go.microsoft.com/fwlink/p/?linkid=236299
64 bit – http://go.microsoft.com/fwlink/p/?linkid=236300
Next, Install the Office 365 Cmdlets
The next thing that you will need is access to the Office365 cmdlets so that you will have the commands that you need to manage your domain.
You will need to download and install these files:
32 bit – http://go.microsoft.com/fwlink/p/?linkid=236298
64 bit – http://go.microsoft.com/fwlink/p/?linkid=236297
Lastly, Connect to Office 365 with the Proper Syntax Scripting
Once you have finished the above you’re ready to actually connect to your Office365 domain. Here is the syntax that you will need to run:
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session -AllowClobber
Connect-MsolService –Credential $O365Cred
Hope this helps Office 365 administrators better administer their Office 365 accounts.