Home‎ > ‎

PowerShell Online

posted Sep 2, 2015, 11:44 AM by Benny Skogberg
Yes, it's possible, but not as extensive as you're familiar on a SharePoint Server. Still, it's useful and as simple as on a SharePoint Sevrer installation. Before you begin - download the SharePoint Online Management Shell​. (I use Windows 8, and didn't need the ​Windows Management Framework 3.0. But if your installation fails, try this installing the WMF 3.0 first)​.

When installed, fire upp the SharePoint Online Management Shell and connect to your SharePoint Online Site using the Connect-SPOService​ cmdlet.​
> ​Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com

Hit enter, and you'll get a Login window to add your password. It's possible to login without the password request window if you type your Connect-SPOService script differently (shown in example 2 of the above link to the cmdlet). However, I save my scripts all the time, and don't want my password to the online site to be un-encrypted. So I type the password every time in the windows password text input field:

Typing the correct password, and you're in. Type Get-SPOSite and see what you got. :)

Saving the script to a .ps1 file, other familiar problems arise. You may need to set execution policy to run the script, and you must run the SharePoint Online Management Shell as administrator, to be able to change execution policy. Right-clicking I saw my other tool available... the PowerShell ISE. So I tried that one instead. If you have the PS ISE installed, no need to download SharePoint Online Management Shell either. Just connect, after you set the execution policy :)

That's it. Now browse through the available cmdlets at ​​Index of Windows PowerShell for SharePoint Online cmdlets​ and see what you can do.​

Happy Scripting!