none
Can't get powershell to assign Office 365 license in script. RRS feed

  • Question

  • To make things short, my co-worker and I have made a Powershell script that creates a new user and deploys them in the correct OU with DG added when put into a certain group. The only big problem I have in this mess, is having the script at the end assign a office 365 license.

    $cred = Get-Credential
    
    Connect-MsolService -Credential = $cred 
       
    Get-MsolUser -UserPrincipalName $UserID@Company.com | Set-MsolUser –UsageLocation US | Set-MsolUserLicense –AddLicenses "Company:EXCHANGEENTERPRISE"

    This is popup I get when the whole scrip runs.

    Supply Values for the following parameters:
    Get-MsolUser –UserPrincipalName $UserID@Company.com | Set-MsolUser –UsageLocation US | Set-MsolUserLicense –AddLicenses "Company:EXCHANGEENTERPRISE"





    • Edited by Thezy2 Friday, September 11, 2015 2:15 PM
    Friday, September 11, 2015 2:08 PM

Answers

All replies