question

AlexVieira-6551 avatar image
0 Votes"
AlexVieira-6551 asked SharonZhao-MSFT edited

Move a list of users from island mode to teamsonly

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


office-teams-windows-itpro
image.png (13.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PedroPetersen avatar image
0 Votes"
PedroPetersen answered AlexVieira-6551 commented

Hello @AlexVieira-6551

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.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PedroPetersen


I'm sorry, in my script there is "\" c: \ temp \ users.csv

Do you know of any way to migrate multiple users from island coexistence mode to TeamsOnly apart from the one that was introduced?

0 Votes 0 ·

Hello @AlexVieira-6551

If you are migrating all users you can change your tenant to TeamsOnly, but if you are migrating only a few users this is the way I believe that fits better your need (and the easy one).

I noticed in your other comment that if you use Get-CsOnlineUser with the csv file it reads the -Identity parameter as expected and it works fine. In this case, you can try changing the line 6 to:

Get-CsOnlineUser -Identity $User.SipAddress | Grant-CsTeamsUpgradePolicy -PolicyName UpgradeToTeams

Once the Get-CsOnlineUsers can get the SipAddress from the csv and populate in the -Identity parameter, this change in the script should work.

Let us know the result.

0 Votes 0 ·

Hi @PedroPetersen

I found the error, the variable $user in -identity . SipAddress was up $users after the change the issue was resolved. Thanks

82832-image.png




data in the file users.csv:

SipAddress
useraccount1@contoso.com
useraccount2@contoso.com

0 Votes 0 ·
image.png (9.2 KiB)
SharonZhao-MSFT avatar image
0 Votes"
SharonZhao-MSFT answered SharonZhao-MSFT edited

@AlexVieira-6551,

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.



· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SharonZhao-MSFT

In fact the incorrect path was a typo here in the forum, follow my script below:

82754-image.png




I checked the attribute "SipAddress" through the cmdlet get-csonlineuser "accounts" | select sipaddress and the data is correct for the file users.csv

0 Votes 0 ·
image.png (9.3 KiB)

Hi @SharonZhao-MSFT

I found the first error, in the csv file I had to add the sipaddress attribute on the first line and then include the accounts for assignment:

SipAddress
user1@contoso.com
user2@contoso.com

however now the following error is displayed when I will try to migrate to TeamsOnly:


Cannot convert 'user1@contoso.com user2@contoso.com' to the type
'Microsoft.Rtc.Management.AD.UserIdParameter' required by parameter 'Identity'. Specified method is not supported.
+ CategoryInfo : InvalidArgument: (:) [Grant-CsTeamsUpgradePolicy], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgradePolicyCmdl
et
+ PSComputerName : api.interfaces.records.teams.microsoft.com



When I run one per migration it works, when I include more than one account generates this error above

0 Votes 0 ·

@AlexVieira-6551,
I'm glad to hear this news.
If you have any other questions on Microsoft Teams in future, please feel free to discuss with us in Q&A forum.
Have a nice day!

0 Votes 0 ·