PowerShell for SharePoint Online


SharePoint Online

In Conjunction with the release of the SharePoint 2013 preview and Office 15 and all the great releases this summer, Microsoft also saw fit to release some info on the support for PowerShell in SharePoint in Office 365 more commonly known simply as SharePoint online.

Have a look at this link:

Windows PowerShell for SharePoint Online
http://technet.microsoft.com/en-us/library/fp161362(v=office.15)

What I regard as a bit cryptic regarding this release is this:
Applies to: SharePoint Online Preview

Update 20120920: Sign up for the preview here: http://go.microsoft.com/fwlink/p/?linkid=257731
I have not spent time figuring out how to get access to a Preview, I’ll rather just read up on the CMD’lets and wait for the support to become general availability.

The list of CMD’lets is limited to just a few, but as a starter, it is a huge leap forward compared to no support, which was what we had before.
The entire list looks like this:

SharePoint Online cmdlets in verb order 

                Cmdlet name                 Description
Add-SPOUser Adds an existing Office 365 user or an Office 365 security group to a SharePoint group.
Connect-SPOService Connects a SharePoint Online global administrator to a SharePoint Online connection (the SharePoint Online Administration Center). This cmdlet must be run before any other SharePoint Online cmdlets can run.
Disconnect-SPOService Disconnects from a SharePoint Online service.
Get-SPOAppErrors Returns application errors.
Get-SPOAppInfo Returns all installed applications.
Get-SPODeletedSite Returns all deleted site collections that are in the Recycle Bin.
Get-SPOSite Returns one or more site collections.
Get-SPOSiteGroup Returns all the groups on the specified site collection.
Get-SPOTenantLogEntry Retrieves SharePoint Online company logs.
Get-SPOTenantLogLastAvailableTimeInUtc Returns the time when the SharePoint Online organization logs are collected.
Get-SPOUser Returns the SharePoint Online user or security group accounts that match given search criteria.
Get-SPOWebTemplate Shows all site templates that match the given identity.
New-SPOSite Creates a new SharePoint Online site collection for the current company.
New-SPOSiteGroup Creates a new group in a SharePoint Online site collection.
Remove-SPODeletedSite Removes a SharePoint Online deleted site collection from the Recycle Bin.
Remove-SPOSite Sends a SharePoint Online site collection to the SharePoint Online Recycle Bin.
Remove-SPOSiteGroup Removes a SharePoint Online group from a site collection.
Remove-SPOUser Removes a user or a security group from a site collection or a group.
Repair-SPOSite Checks and repairs the specified site collection and its contents.
Request-SPOUpgradeEvaluationSite Requests to create a copy of an existing site collection for the purposes of validating the effects of upgrade without affecting the original site.
Restore-SPODeletedSite Restores a SharePoint Online deleted site collection from the Recycle Bin.
Set-SPOSite Sets or updates the values of one or more properties for a site collection.
Set-SPOSiteGroup Updates the SharePoint Online owner and permission level on a group inside a site collection.
Set-SPOTenant Sets properties on the SharePoint Online organization.
Set-SPOUser Configures properties on an existing user.
Test-SPOSite Tests a SharePoint Online site collection.
Upgrade-SPOSite Starts the upgrade process on a site collection.

Enjoy!

Regards

Twitter | Technet Profile | LinkedIn

17 thoughts on “PowerShell for SharePoint Online

  1. Whenever i try to the use the New-SPOsite, Powershell online tells me the command does not exist.

    I have run the import-Module MSOnline . When i run the Get-Command -Module MSOnline it does not even list the New-SPOsite as a cmdlet.

    How can i create a new site collection on SharePoint online, any ideas?

    Thanks

    1. Hi Bob.
      If you follow the link you will find this instruction:
      Perform the following:
      -Install Windows PowerShell 3.0 from Windows Management Framework 3.0 – Beta.
      -Install the SharePoint Online Management Shell from the Microsoft Download Center.
      -Click Start>All Programs>SharePoint Online Management Shell.
      -Run Connect-SPOService. For example, Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com
      where:
      Url is the URL of the SharePoint Online Administration Center.
      Credential is the user name to which you want to grant access to the SharePoint Online Administration Center site.

      Try it out! For example, run Get-SPOSite to get a list of all sites.

      Regards
      // Thomas

      1. Hi Thomas,

        I followed the instructions. Installed the files etc..
        When i try to connect to the online service via Connect-SPOService, and i enter the URl, it says “Could not connect to Sharepoint online : unsupported”

  2. O i see.
    I must be using the old/current version… You say the old current version does not support Powershell, but i can do certain things like create new users via powershell… As when i import the MSonline module, it does give me a set of Powershell commands to use.

    So to confirm, to create a new site or site collection, i need to be using the Office 365 preview site?

    1. Hi.
      Yes, correct. The current version of Office 365 has PowerSHell support for Exchange and user administration. ALl SharePoint support is new and will be available once Office 365 is upgraded to what is now the ‘preview’.
      PowerShell support for SharePoint online has in my opinion been long overdue…soon…;-)

      Regards
      // Thomas

      1. The identity has not been authenticated? , any ideas, thats the error im receiving.

  3. im not having no luck.
    Created a free office 365 preview site….. trying to create a new site collection via powershell..

    When i try to connect-SPOServer -url {Admin site url} -credential {admin account}

    it just says Could not connect to SharePoint Online. 😦

  4. Does not work. I have 2013 beta site. Installed PS3.0 etc.
    PS C:\Windows\system32> Connect-SPOService -Url {adminurl} -Credential $cred
    Connect-SPOService : Value does not fall within the expected range.

      1. Yes followed that article to the letter. Can logon via browser to admin url and credentials.

        Verzonden vanaf Samsung Mobile

        blksthl schreef: Thomas Balkesthl commented: “Hi. Not sure what you are doing exactly: ‘I have 2013 beta site. Installed PS3.0 etc.’. Does this mean that you have SharePoint Server 2013 Onprem or a SharePoint online preview? If you have an onprem server then you can stop trying, all of the nnnn-SPOnn”

    1. Hi thomas It is SharePoint Online Office365 Preview 2013

      Verzonden vanaf Samsung Mobile

      blksthl schreef: carry2web commented: “Hmm, or this one: connect-sposervice : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))”

  5. Just a quick note in case it is useful for anyone out there. I ran into the same error “Connect-SPOService : Value does not fall within the expected range” and it turned out to be related to the network that I’m using. Once I changed to different network, it worked fine. The problem, in my case, is most likely caused by domain controller’s blocking the command/traffic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s