Cannot Assign Phone Number to Ressource Account via PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-2364196%22%20slang%3D%22en-US%22%3ECannot%20Assign%20Phone%20Number%20to%20Ressource%20Account%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2364196%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20implement%20a%20script%20to%20assign%20phone%20numbers%20to%20resource%20account%20through%20teams%2C%20but%20unfortunately%2C%20I%20keep%20getting%20an%20error%20stating%20the%20format%20is%20not%20valid.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlthough%2C%20when%20trying%20to%20assign%20the%20number%20through%20the%20GUI%2C%20it%20is%20possible%20and%20with%20no%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20an%20example%20of%20the%20command%20I'm%20trying%20to%20use%3C%2FP%3E%3CP%3ESet-CsOnlineVoiceApplicationInstance%20-Identity%20%24ID%20-TelephoneNumber%20-33xxxxxxxx%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOf%20course%20a%20virtual%20license%20is%20assigned%20to%20the%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20something%20that%20I%20might%20have%20forgotten%20to%20apply%20for%20it%20to%20work%20correctly%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2364196%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2365633%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20Assign%20Phone%20Number%20to%20Ressource%20Account%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2365633%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3Ethe%20docs%20say%20the%20command%20should%20look%20like%20this%3A%3CBR%20%2F%3ESet-CsOnlineVoiceApplicationInstance%20-Identity%20testra1%40contoso.com%20-TelephoneNumber%20%2B14255550100%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20this%20supposed%20to%20be%20a%20french%20number%2C%20it%20would%20look%20like%20%2B33xxxxxxxx%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fskype%2Fset-csonlinevoiceapplicationinstance%3Fview%3Dskype-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fskype%2Fset-csonlinevoiceapplicationinstance%3Fview%3Dskype-ps%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi

 

I'm trying to implement a script to assign phone numbers to resource account through teams, but unfortunately, I keep getting an error stating the format is not valid.

 

Although, when trying to assign the number through the GUI, it is possible and with no issue.

 

Here's an example of the command I'm trying to use

Set-CsOnlineVoiceApplicationInstance -Identity $ID -TelephoneNumber -33xxxxxxxx

 

Of course a virtual license is assigned to the account.

 

Is there something that I might have forgotten to apply for it to work correctly?

 

Thank you for your help

4 Replies
Hi,

the docs say the command should look like this:
Set-CsOnlineVoiceApplicationInstance -Identity testra1@contoso.com -TelephoneNumber +14255550100

If this supposed to be a french number, it would look like +33xxxxxxxx
https://docs.microsoft.com/en-us/powershell/module/skype/set-csonlinevoiceapplicationinstance?view=s...

Hope this helps
Hi,

I am aware of the docs, I just put $Id which is the ObjectID of the Ressource Account.
Of course I did test with the UPN and have the same result.

As for the number, yes, it is a French number, with 9 digits after +33

But after some more in-depth check, it seems the issue is with the tenant as I cannot assign a phone number to a resource account even with the GUI.

I'll see with Microsoft support about the issue.

Thank you
One thing is worth a check. What is the type of the number you are trying to assign? It should be a service number if you want to assign it to a resource account.
Yes of course it is a service number.

I can't assign anything but a service number from the ressource account menu on teams anyway.