Manage Sharepoint Online using Powershell

If you familiar enough with the sharepoint online feature and administration, we can continue to explore how to manage our sharepoint online using shell.


Open the Shell

After you have done the installation, you can open the SPO Management Shell by type to sharepoint to on your start-apps. Then right click and run as administrator.

run as admin

Setup Proxy

Because our company is behind proxy, we should execute this command to use dafault proxy:

$cred = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred

Connect to SharePoint Online

After that, we can try to connect to our sharepoint, using Connect-SPOService:

$adminUPN="<the full email address of a SharePoint Online global administrator account, example:>"
$orgName="<name of your Office 365 organization, example: contosotoycompany>"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$ -Credential $userCredential

below is example of mine:

$userCredential = Get-Credential -UserName $adminUPN -Message "why-you-soRUDe123"
Connect-SPOService -Url https://$ -Credential $userCredential

Sample Command

After you successful connect to your site, now you should try a command to manage your SharePoint. Below is sample command to create subsite on your site.

New-SPOSite -Url -Owner putu_p@spmitrais.onmicros -StorageQuota 1000 -Title "Hello it is Me!"


You should go to microsoft site for complete references.


Kembali ke Beranda