question

StephanG avatar image
0 Votes"
StephanG asked SharonZhao-MSFT commented

Set-CSUser - LineURI - which right is needed by the executor

Hi,

i wrote a handy PowerShell that would allow my not so PowerShell experienced colleague to easily manage the phone numbers of our "Teams Voice" Users. As i am looking for "least privilege" i want to give him.
I thought "Teams Communication Admin" would be the role that should fit to this role.
But if he executes the script - he gets an error.
I can execute it without problems (same machine/same settings).

But i am a "global admin" - so no permission issues here.
I could not find a doc about it - so maybe you can help me out here.

I will share the script in the gallery (or how it is named now - as soon as i am sure it will work)

office-teams-windows-itprooffice-skype-business-server-enterprise-voice
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.

1 Answer

SharonZhao-MSFT avatar image
0 Votes"
SharonZhao-MSFT answered SharonZhao-MSFT commented

@StephanG,

Could you share with us the error message of Teams communication administrator?

It recommends you try to use Set-CsOnlineVoiceUser command to set the PSTN specific parameters, such as telephone numbers and emergency response locations. I tested this command with Teams communication administrator and it works well.


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.



· 15
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.

I will try to replace the command with the other one and get back as soon as possible.

0 Votes 0 ·

@StephanG,
How is going now?
Please feel free to drop us any note.
Have a good day!

0 Votes 0 ·

I try to replace the command
Set-CsUser -Identity $Mail -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI "tel:$phonenumber"

But as i look into the help for the new command - i only have the phone number
Am i right that i need:
Set-CsOnlineVoiceUser
Set-CsOnlineVoicemailUserSettings then?

And the Enterprise Voice enabled is set to "true" as soon as i assign a phone number?

0 Votes 0 ·

@StephanG,

I do some more researches and find that user must be the Global Administrator role and be able to run remote PowerShell to enable Phone System and voicemail. So, if you want to enable Phone System voice services for user in script, it must be Global Administrator. The following is the quote of official document:
120112-image.png

For more details, please refer to this document.


0 Votes 0 ·
image.png (20.9 KiB)

So it would be an option to enable enterprise voice and voicemail for every user as a scheduled script?
Having a global admin on line to "assign phone numbers" does not seem right :)

I really get far. With the Teams Communication Admin i can
Grant-CsOnlineVoiceRoutingPolicies
Set-CsOnlineVoicemailUserSettings -Identity $Mail -VoicemailEnabled $true

But when i try to
Set-CsOnlineVoiceUser -Identity $Mail -TelephoneNumber $phonenumber
I get the error: "This user is not licensed for PSTN Calling. To assign a telephone number to a user, the user must first be licensed for PSTN Calling."
User has the "Phone System" license for 2 years so it cannot be a "24h cloud thing".

These are the informations of my test user
RunspaceId : x
Name : Test, Rainer
Id : x
TenantId : x
Number :
LicenseState : Licensed
Location :
PSTNConnectivity : OnPremises
UsageLocation : DE
EnterpriseVoiceEnabled : False

I think the problem is that i cannot set EnterpriseVoiceEnabled to true.
I can do that with set-csuser but only with more rights. Or is there something that also can flip that to true?

0 Votes 0 ·
Show more comments