Apr 19 2020 03:55 AM - edited Apr 19 2020 03:55 AM
import-csv C:\Users\ashis\Desktop\conf.csv -Header userprincipalname | ForEach-Object {Grant-CsDialoutPolicy -PolicyName "DialoutCPCDisabledPSTNInternational"}
I am running above command to disable dialout for selected users, however getting attached error each time I run it.
Second Question:-
Also, I want to know how can I have dial out disabled automatically for all new users that get's provisioned. I thought I could do it set-csdialoutpolicy but there is no such command.
As of now, any users that get provisioned have dialoutpolicy set to blank, I want to by default set it to
DialoutCPCDisabledPSTNInternational. Please help me with the powershell command for that.
Apr 19 2020 11:10 AM - edited Apr 19 2020 11:13 AM
Hi @Ashish Mangtani,
does the command (Grant-CsDialoutPolicy) work for a single user?
Grant-CsDialoutPolicy -Identity "ken.myer@contoso.com" -PolicyName "DialoutCPCDisabledPSTNInternational"
If you want to update multiple users I would recommend that you use the new "New-CsBatchPolicyAssignmentOperation" cmd'let. I have written down the necessary steps to get there.
https://paul-lange.net/assign-policies-in-microsoft-teams-the-easy-way/
I heard the feature is now GA but haven't tested if it is now working without the Teams preview module.
Regarding the second question, I would recommend that you grant this policy during user provisioning in a script. We are doing it the same way. To my knowledge, there is no way of setting a more restricted policy as a default.
Regards,
Paul