I hope to find near you a solution to my problem.
Here is the problem:
I have a test template for creating user accounts on our active directory and also on Office 365 and the skype line (we are in a hybrid environment).
For a few months, we have switched to Teams Only mode and this automatically leads to the deletion of the skype part on my template. however, I cannot get the TELEPHONE NUMBER line from my template to match Teams.
I set up a script on the custom attributes part (see image and script) but, I don't know if this one is ok to automatically assign the number to the user when creating the account.
would it be possible to help me?
I am running out of solution.
- Import-Module SkypeOnlineConnector
- $userCredential = Get-Credential
- Connect-MicrosoftTeams -credential $usercredential
- Connect-AzureAD -Credential $usercredential
- #add user to Team
- set-csuser -Identity $args -EnterpriseVoiceEnabled $True -HostedVoiceMail $true
- #user policy
- Grant-CsTeamsUpgradePolicy -Identity $args -PolicyName UpgradeToTeams
- Grant-CsTenantDialPlan -Identity $args -PolicyName 'MyPolicy'