Home > Office 365, Powershell, SharePoint Online > PowerShell for SharePoint Online

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

  1. Bob
    September 19, 2012 at 16:07

    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

    • September 20, 2012 at 12:53

      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

      • Bob
        October 3, 2012 at 09:42

        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”

      • October 3, 2012 at 09:47

        Hi Bob.
        The SharePoint online site you connect to, has to be a Office 365 Preview site (http://www.microsoft.com/office/preview/en/whats-new)
        The ‘old/current’ Office 365/SharePoint Online still don’t support PowerShell.
        Sounds like this is what you are trying to access?
        Regards
        // Thomas

  2. Bob
    October 3, 2012 at 09:58

    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?

    • October 3, 2012 at 10:03

      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

      • Bob
        October 3, 2012 at 11:11

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

  3. Bob
    October 3, 2012 at 10:48

    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. Carry Megens
    February 22, 2013 at 23:48

    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.

  5. February 22, 2013 at 23:49

    Got to this point, but when trying to connect to 2013 preview admin
    Connect-SPOService : Value does not fall within the expected range.

  6. February 23, 2013 at 00:21

    Hmm, or this one: connect-sposervice : Catastrophic failure (Exception from HRESULT: 0x8000FFFF
    (E_UNEXPECTED))

    • February 23, 2013 at 00:27

      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-SPOnnnnn CMD’lets are for SharePoint online(preview) only.
      If it is Online, did you follow this to the letter:
      http://technet.microsoft.com/en-us/library/fp161372

      Regards

      • Carry Megens
        February 23, 2013 at 00:55

        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”

      • February 24, 2013 at 09:27

        Hi Carry.
        Sorry, did or do not have time to test that again which would be the only way to give any good assistance.
        I recommend that you submit a Q to the SharePoint 2013 forum. Use this forum for SharePoint Online Q’s:
        http://social.technet.microsoft.com/Forums/en-us/onlineservicessharepoint/threads

        Good luck!
        // Thomas

    • Carry Megens
      February 23, 2013 at 00:52

      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))”

  7. February 5, 2014 at 21:36

    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.

  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: