User:Sfiggins/Teams & S4B Powershell
From Labrats.us
< User:Sfiggins
Jump to navigationJump to searchRevision as of 01:27, 17 March 2021 by Sfiggins (talk | contribs) (→Set User to use PGI as Conference Provider)
Set Execution Policy
Start Powershell as administrator.
Run Set-ExecutionPolicy command.
PS C:\> Set-ExecutionPolicy -ExecutionPolicy Bypass Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
Verify that the policy took affect.
PS C:\> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser Undefined LocalMachine Bypass
Install MS Teams Powershell Module
In powershell, run the following.
PS C:\> Install-Module MicrosoftTeams Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the `Set-PSRepository` cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-install
Connect / login to the MS Teams / S4B Connector
You can do the rest as the a non-administrator user.
Import-Module MicrosoftTeams $credential = Get-Credential Connect-MicrosoftTeams -Credential $credential
Assign "Microsoft" as the Conference Provider
PS C:\> .\script.ps1 -userlist "user@labrats.us" Number of users to have their audio conferencing provider set to Microsoft: 1 WARNING: "OriginalRegistrarPool" with identity "1972340558" assigned to "sip:user@labrats.us" has been removed from configuration store. The provider of user@labrats.us has changed to Microsoft. RunspaceId : 90419993-79b4-4c75-b7c7-f6e06e4676fc Identity : ab2cf895-db4a-4a27-9e6a-74154fbed58b SipAddress : sip:user@labrats.us ServiceNumber : 17203709609 TollFreeServiceNumber : ConferenceId : 0 BridgeId : f862865b-d49e-42be-8c67-1952c9ca8644 BridgeName : Conference Bridge Tenant : ce701975-2de8-4dbf-a876-0ab0e031fa9c AllowPstnOnlyMeetings : False AllowTollFreeDialIn : True LeaderPin : 50554
Verify Settings as Microsoft
PS C:\> Get-CsUserAcp -Identity "user@labrats.us" RunspaceId : 90419993-79b4-4c75-b7c7-f6e06e4676fc AcpInfo : {<acpInformation default="true"> <tollNumber>17203709609</tollNumber> <participantPassCode>0</participantPassCode> <domain>resources.lync.com</domain> <name>Microsoft</name> <url>https://dialin.lync.com/f862865b-d49e-42be-8c67-1952c9ca8644</url> </acpInformation>} Name : ab2cf895-db4a-4a27-9e6a-74154fbed58b DistinguishedName : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Identity : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Guid : 8d53d4fe-e7e2-4a73-ad0f-1cc20ae06593 ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=lync0a001,DC=local ObjectClass : {top, person, organizationalPerson, user} WhenChanged : 3/16/2021 6:54:45 PM WhenCreated : 1/28/2016 8:16:30 AM OriginatingServer : WU20A00ADS01.lync0a001.local IsByPassValidation : False IsValid : True ObjectState : Unchanged
Set User to use PGI as Conference Provider
First, you may need to remove the configuration for the user.
PS C:\> Remove-CsUserAcp -Identity "user@labrats.us"
Verify that the configuration was removed.
PS C:\> Get-CsUserAcp -Identity "user@labrats.us" RunspaceId : 90419993-79b4-4c75-b7c7-f6e06e4676fc AcpInfo : {} Name : ab2cf895-db4a-4a27-9e6a-74154fbed58b DistinguishedName : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Identity : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Guid : 8d53d4fe-e7e2-4a73-ad0f-1cc20ae06593 ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=lync0a001,DC=local ObjectClass : {top, person, organizationalPerson, user} WhenChanged : 3/16/2021 7:07:43 PM WhenCreated : 1/28/2016 8:16:30 AM OriginatingServer : WU20A00ADS01.lync0a001.local IsByPassValidation : False IsValid : True ObjectState : Unchanged
Next, you can set the user to PGI.
PS C:\> Set-CsUserAcp -Identity "user@labrats.us" -TollNumber "16054755602" ` -TollFreeNumber '17127704201' -ParticipantPassCode 981705 -Domain "lync.pgi.com" ` -Name "PGi" -Url "http://www.pgi.com/lynconline/localnums.php"
Verifying the user was set to PGI.
PS C:\> Get-CsUserAcp -Identity "user@labrats.us" RunspaceId : 90419993-79b4-4c75-b7c7-f6e06e4676fc AcpInfo : {<acpInformation> <tollNumber>1 (712) 770-4201</tollNumber> <participantPassCode>981705</participantPassCode> <domain>lync.pgi.com</domain> <name>PGi</name> <url>http://www.pgi.com/lynconline/localnums.php</url> </acpInformation>} Name : ab2cf895-db4a-4a27-9e6a-74154fbed58b DistinguishedName : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Identity : CN=ab2cf895-db4a-4a27-9e6a-74154fbed58b,OU=ce701975-2de8-4dbf-a876-0ab0e031fa9c,OU=OCS Tenants,DC=lync0a001,DC=local Guid : 8d53d4fe-e7e2-4a73-ad0f-1cc20ae06593 ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=lync0a001,DC=local ObjectClass : {top, person, organizationalPerson, user} WhenChanged : 3/16/2021 7:07:58 PM WhenCreated : 1/28/2016 8:16:30 AM OriginatingServer : WU20A00ADS01.lync0a001.local IsByPassValidation : False IsValid : True ObjectState : Unchanged