Forum Discussion
Teams User eine Rufnummer Nummer aus CSV zuweisen
- Nov 04, 2020I found the problem. Some numbers was already given to some users. After i deletet the numbers the import from the csv is working.
I'm trying to add a phone number to the team users via CSV.
My CSV accounts.csv is structured as follows:
Idetntity,URI
email1@mail.com, tel:+49123456789
email2@mail.com, tel:+49234567891
Now I try to read the CSV with the following command.
$dataSetFilePath = "C:\Users\admin\Desktop\CSV\account.csv "
$dataSet = Import csv "$($dataSetFilePath)" -delimiter ","
foreach($item in $dataSet)
{
$Identity = $item.Identity
$URI = $item.URI
Set-CsUser -Identity $Identity -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI $URI
}
But I get the following error and can't figure out where the crack is:
The filter did not return a unique result, "[SipAddress : sip:email1@mail.com] [LineURI :
tel:+49123456789] [PrivateLine : tel:+49123456789] ".
+ CategoryInfo : InvalidOperation: (Set-CsUser:String) [Set-CsUser], InvalidOperationException
+ FullyQualifiedErrorId : ProcessRecord,Microsoft.Rtc.Management.AD.Cmdlets.SetOcsUserCmdlet
+ PSComputerName : admin3e.online.lync.com
Translated with http://www.DeepL.com/Translator (free version)
- _-loading-_Nov 04, 2020Copper ContributorI found the problem. Some numbers was already given to some users. After i deletet the numbers the import from the csv is working.