cannot bind argument to parameter userprinciple name because it is null

Anonymous
2017-06-05T19:31:13+00:00

Hi Team,

I was refering the below link:

https://technet.microsoft.com/en-us/library/dn771774.aspx

While performing for a list of user it shows error cannot bind argument to parameter userprinciple name because it is null.

Azure is able to read my txt file also if a perform for single user we are able to remove licenses but I have 1200 user list.

Want to do it ASAP.Please help.

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2017-06-07T05:55:25+00:00

    Hi Shivam,

    To bulk remove license, please follow the steps below:

    1. Connect to an Office 365 account:

    $UserCredential = Get-Credential

    Connect-MsolService -Credential $UserCredential

    1. Create a .csv file to list all accounts. You can download the example file to see the format and add accounts into it.
    2. Import the .CSV file to $user

    $Users=Import-Csv C:\the path of the .csv file\test.csv

    1. Remove license:

    $Users | ForEach{Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses AccountSkuId}

    Note: replace AccountSkuId for your license plan. Use Get-MsolAccountSku to get  AccountSkuId.

    If the issue persists, welcome back with a screenshot about your script.

    Regards,

    Linda

    4 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-06-06T09:45:53+00:00

    Hi Shivam,

    I got the same result when perform steps in Use a list of specific accounts part in the link. Please give us some time to consult with our related team with that.

    Thanks for your time.

    Linda

    0 comments No comments
  2. Anonymous
    2017-06-08T07:40:01+00:00

    Hi Shivam,

    Have you checked the above information?

    Regards,

    Linda

    0 comments No comments