ACP sample script for regionally hosted meetings

 

上次修改主題的時間:2017-06-28

Read this topic to view a sample script for configuring an audio conferencing provider to work with regionally hosted meetings.

註記注意事項:
Regionally hosted meetings is available for limited release only. For more information about the limited release, please contact your Microsoft representative.

For more information, see Plan for regionally hosted meetings in Skype for Business Online, Set up and configure regionally hosted meetings in Skype for Business Online, and Configure your ACP to support regionally hosted meetings.

重要重要事項:
The following sample script is provided for reference only. It is not intended for production use. To lab test, the $csv and $outputArray path/filename values may need updating.

# UpdateACP_InterCall.PS1 - Rick Varvel
# READ IN AN ACP VENDOR CSV INPUT FILE (INTERCALL SPECIFIC) AND USE IT TO MODIFY EXISTING ACPINFO WITH UPDATED DIALIN CONFERENCING COORDINATES 
   TO MATCH THE TARGET REGION SO THAT USERS CAN BE MOVED CROSS REGION AND MAINTAIN DIALIN CONFERENCING SUPPORT
# 
# This script assumes an input file with 4 columns; SIP Address, TollNumber, TollFreeNumber and PassCode (in CSV format), and uses it to build the input array
# It then runs Get-CsOnlineUser for each user in the input array, grabbing the existing AcpInfo values and storing them in a TMP array. If values are missing
    from the input file (for example TollFreeNumber), the script checks to see whether there were existing values and if so, uses them; otherwise the value is 
    left blank
# The information is then written to a CSV output file, which can be used to confirm that the AcpInfo was set correctly
#
 
$csv = "UserInput_InterCall.csv"
$csv = Resolve-Path $csv

# Store input file into an array - Expecting this format -Identity newUser@company.com -TollNumber "newTollNumber" -TollFreeNumber "newTollFreeNumber" 
-ParticipantPassCode "newPassCode" $users = Import-Csv -Delimiter "," -Path $csv -Encoding "UTF8" -Header @("Identity", "TollNumber", "TollFreeNumber",
 "ParticipantPassCode")

# Create an array for the output report
$outputArray = @()

foreach ($user in $users) {
 
    $identity = $user.Identity

    # Get AcpInfo as a string
    [string] $tmpAcp = (Get-CsUserAcp -Identity $identity).AcpInfo 
    
    # Convert string to XML
    $inputXml = [xml] $tmpAcp

    # DEBUG
    # $myName = $inputXml.acpInformation.name
    # $tollNumber = $user.TollNumber
    # $tollFreeNumber = $user.TollFreeNumber
    # $participantPassCode = $user.ParticipantPassCode
    # Write-Output (" User - $identity | Toll Number = $tollNumber | Toll Free Number = $tollFreeNumber | Pass Code = $participantPassCode | Name = $myName")
    # Pause

    # Populate AcpInfo variables that change when user is moved cross region (from InterCall CSV)
    # If user has InterCall already or AcpInfo is blank, use values from input file, otherwise keep existing TollNumber, TollFreeNumber and ParticipantPassCode
    If (($inputXml.acpInformation.name -eq "intercall") -or ($inputXml.acpInformation.name -eq $Null)) {
        $tollNumber = $user.TollNumber
        $tollFreeNumber = $user.TollFreeNumber
        $participantPassCode = $user.ParticipantPassCode
        # Write-Output "from CSV"
        # Pause
    }
    Else {
        $tollNumber = $inputXml.acpInformation.tollNumber
        $tollFreeNumber = $inputXml.acpInformation.tollFreeNumber
        $participantPassCode = $inputXml.acpInformation.participantPassCode
        # Write-Output "from XML"
        # Pause
    }
    If ($participantPassCode -eq $Null) {
        Write-Output ("Particpant PassCode is blank - Expecting this format Identity newUser@company.com TollNumber newTollNumber TollFreeNumber 
        newTollFreeNumber ParticipantPassCode newPassCode")
        Write-Output ""
        Exit
    }

    # Populate remainder of AcpInfo variables from existing user settings
    $domain = $inputXml.acpInformation.domain
    $name = $inputXml.acpInformation.name
    $url = $inputXml.acpInformation.url

    # If user is not currently enabled for InterCall, set the three defaults
    If ($domain -eq $Null) {
        $domain =  "mslync.audiocontrols.net"
    }
    If ($name -eq $Null) {
        $name = "intercall"
    }
    If ($url -eq $Null) {
        $url = "http://www.intercall.com/l/dial-in-number-lookup.php"
    }

# Write-Output ("User - $identity | Toll Number = $tollNumber | Toll Free Number = $tollFreeNumber | Pass Code = $participantPassCode |
   Acp Domain = $domain | Acp Provider = $name | Find Local Number URL = $url")
# Pause


    ######################
    # Remove Existing AcpInfo
    ######################

    If (($name -eq "intercall") -or ($name -eq $Null)) {
        Remove-CsUserAcp -Identity $identity
        # Write-Output "  Running Remove-CsUserAcp for user $identity"
    }
    Else {
        # Write-Output "  Account is not enabled for InterCall or AcpInfo is not available - did NOT run Remove-CsUserAcp for user $identity"
    }


    ######################
    # Set New AcpInfo
    ######################

# Write-Output ("User - $identity | Toll Number = $tollNumber | Toll Free Number = $tollFreeNumber | Pass Code = $participantPassCode |
   Acp Domain = $domain | Acp Provider = $name | Find Local Number URL = $url")
# Pause

    If (($name -eq "intercall") -or ($name -eq $Null)) {
        Set-CsUserAcp -Identity $identity -TollNumber $tollNumber -TollFreeNumber $tollFreeNumber -ParticipantPassCode $participantPassCode 
       -Domain $domain -Name $name -URL $url $acpTimeStamp = (Get-Date).ToString()
        # Write-Output "  $acpTimeStamp - AcpInfo updated for user $identity with ACP Provider = $name"
    }
    Else {
        # Write-Output "  Account is not enabled for InterCall or AcpInfo is not available - did NOT run Set-CsUserAcp for user $identity"

    }


    ######################
    # Manually Trigger MMS
    ######################

    If (($name -eq "intercall") -or ($name -eq $Null)) {
        Start-CsExMeetingMigration -Identity $identity
        $mmsTimeStamp = (Get-Date).ToString()
        # Write-Output "  $mmsTimeStamp - Meeting Migration Service manually triggered for user $identity with ACP Proivder = $name"
    }
    Else {
        # Write-Output "  Account is not enabled for InterCall or AcpInfo is not available - did NOT trigger the Meeting Migartion Service for user $identity 
            with ACP Proivder = $name"
    }

# Write-Output ("User - $identity | Toll Number = $tollNumber | Toll Free Number = $tollFreeNumber | Pass Code = $participantPassCode")
# Pause

    # Crete Output Array
    $rhmUser = New-Object PSObject
    $rhmUser | add-member -membertype NoteProperty -name "Identity" -value "$identity"
    $rhmUser | add-member -membertype NoteProperty -name "Acp Start" -value "$acpTimeStamp"
    $rhmUser | add-member -membertype NoteProperty -name "MMS Start" -value "$mmsTimeStamp"
    $rhmUser | add-member -membertype NoteProperty -name "Toll Number" -value "$tollNumber"
    $rhmUser | add-member -membertype NoteProperty -name "Toll Free Number" -value "$tollFreeNumber"
    $rhmUser | add-member -membertype NoteProperty -name "Pass Code" -value "$participantPassCode"
    $rhmUser | add-member -membertype NoteProperty -name "Acp Domain" -value "$domain"
    $rhmUser | add-member -membertype NoteProperty -name "Acp Provider" -value "$name"
    $rhmUser | add-member -membertype NoteProperty -name "Find Local Number URL" -value "$url"

    $outputArray += $rhmUser
}
# Create Progress Report
$outputArray | Export-Csv -Path "UserOutput_InterCall.csv" -Delimiter "," -NoTypeInformation

 
顯示: