Microsoft

Blog Categories

Subscribe to RSS feed

Archives

Activate Office365 users via Powershell

With general availability of Office365 in the horizon, new features are being activated every day. One such long-awaited feature is activating users via Powershell instead of from the portal site. To do so follow these steps:


  • Connect to office 365 with following commandlets
    • $cred = get-credential (enter your Office365 administrator credentials when prompted)
    • Connect-msolservice –credential $cred
  • To view the available licenses:
    • For the entire company, run the command: Get-msolsubscription | select skupartnumber, totallicenses | ft –autosize


    • For a particular user, run the command: get-msoluser –userprincipalname “UPN of user” | select licenses, islicensed | fl


  • Assign a license for a user with the command: set-msoluserlicense –userprincipalname “UPN of user” –addlicenses “name of license”

    This of course can be scripted to assign licenses in mass with import-csv command.


It’s also possible to assign licenses granularly to just a specific product like Sharepoint or Exchange with the command new-msollicenseoptions. For example to grant all licenses except the Office license:



Tags: ,

Leave a Reply