Tuesday, August 18, 2015

Connect to Office 365 using PowerShell

Referred Link - http://www.learningsharepoint.com/2015/08/17/connect-to-office-365-using-powershell/

Here are the high-level Steps to Connect to Office 365 using PowerShell :
2. Next, download SharePoint Online Management Shell 64-bit.
3. Next, open the SharePoint Online Management Shell as an administrator (right click run as an administrator).
4. Run Get-ExecutionPolicy and see what it is set to. If the execution policy is set to anything other than Unrestricted or RemoteSigned you’ll encounter an error when you try to import a module.
Use Set-ExecutionPolicy RemoteSigned.
5. Next, Run $credential = Get-Credential to create a PowerShell object. Add the admin Login e-mail and Password to build credential object.
6. Next, lets connect to Office 365.
a) Run Import-Module MsOnline – This is to import the Office 365 module.Run Get-Module to verify.
b) Next, connect to Office 365 Use Connect-MsolService -Credential $credential
By providing $credential element, Office 365 will automatically connect you to the correct domain.
Connect Office 365 PowerShell
7. Next we will Connect to SharePoint Online.
Connect-SPOService -Url https://learningwayinstitute-admin.sharepoint.com -credential $credential
Note : Make sure the SharePoint online site has – admin append to the url.
Connect to Office 365

No comments: