Move a list of users from island mode to teamsonly

Alex Vieira 41 Reputation points
2021-03-29T19:31:48.687+00:00

Hi dear

I'm trying to move some users from island mode to TeamsOnly mode in my organization but I'm not getting it, the error message when I run the script below is:

82495-image.png
Cannot validate argument on parameter 'Identity'. The argument is null or empty. Provide an argument that is not null
or empty, and then try the command again.

  • CategoryInfo : InvalidData: (:) [Grant-CsTeamsUpgradePolicy], ParameterBindingValidationException
  • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgrad
    ePolicyCmdlet
  • PSComputerName : api.interfaces.records.teams.microsoft.com

Here's the script I'm trying to run:

$Users = Import-Csv -Path c:tempusers.csv

foreach($User in $Users)
{

Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams

}

Would anyone have an idea how I can perform the procedure? I've searched the web but i've had no evolution.

Thank you

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,042 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pedro Petersen 171 Reputation points
    2021-03-30T01:12:26.497+00:00

    Hello @Alex Vieira

    I'm not sure if this would cause this error, but I can see a missed backslash ( \ ) in the first line of your script.
    It should be like:

    $Users = Import-Csv -Path c:\tempusers.csv

    If this does not solve the issue, double check if the first line of the column where your users' SipAddress are inserted is named SipAddress.


1 additional answer

Sort by: Most helpful
  1. Sharon Zhao-MSFT 25,051 Reputation points Microsoft Vendor
    2021-03-30T05:32:03.917+00:00

    @Alex Vieira ,

    The first command should be changed from:

    $Users = Import-Csv -Path c:tempusers.csv

    To:

    $Users = Import-Csv -Path c:tempusers.csv

    According to my experience, you could move the location of tempusers.csv file to certain folder in drive C, such as C:\temp\tempusers.csv. Then, try again.

    In addition, the error message indicates that Identity parameter is null or empty. It recommends you check if the content of tempuser.csv file is correct.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.