Oct 21 2020 10:47 PM
Hi Everyone,
i have created a provisioning Script for the creation of the resource accounts / callqueue / autoattendant but the final steps 7&8 (assign resource account) is missing. I have found informations how to assign them in teams admin center (GUI) but not via powershell. Does someone know how to assign the RA to the CQ or a AA via powershell ?
Scripting Plan:
Dec 16 2020 07:08 AM
No Not Yet . ressource account creation is a nightmare !!!
Feb 08 2021 09:46 AM
I'm not sure the previous response to this is valid. The commands you're looking for are *-CsOnlineApplicationInstanceAssociation. Based on documentation, the command New-CsOnlineApplicationInstanceAssociation has been around since at least December 2018.
Basic usage would look like this:
$ResourceAccountId = (Get-CsOnlineUser "autoattendant@example.com").ObjectId
$AutoAttendant = (Get-CsAutoAttendant -NameFilter "Main Auto Attendant").Identity
New-CsOnlineApplicationInstanceAssociation -Identities @($ResourceAccountId) -ConfigurationId $AutoAttendant -ConfigurationType AutoAttendant
Same for Call Queues except using Get-CsCallQueue and changing the ConfigurationType to CallQueue.
Jun 11 2021 05:11 PM - edited Jun 11 2021 05:12 PM
Worked great. I'm used to using the GUI but this is a much faster method and used when Microsoft was rolling back an update.
Oct 29 2021 09:21 AM
Nov 04 2021 03:58 AM
I'm on the same situation here (skype hybrid decom)
you have two options:
1.Major outage (as first you need to point DNS to MS, not your onprem, so you break your hybrid res accnt) and only then you can create pureonlineinstance with your current domain
2. (my aproach) create res accnts with online tenant yourdomain.onmicrosoft.com
no other options
cheers,
Dec 18 2021 02:35 PM - edited Dec 18 2021 02:43 PM
Apparently, Microsoft magically provided the ability to create resource accounts directly Online using the New-CsOnlineApplicationInstance cmdlet BEFORE REMOVING THE HYBRID. The option to create the resource accounts was still not working from the Admin Center. I have shown this to couple of guys from Microsoft's support one of them being UC specialist from the Fast Track team and they were extremely surprised it works. We have decommissioned Skype today, 2 weeks after creating the accounts and running the services in Hybrid mode with both Direct Routing on-prem numbers and Calling Plans:)
We have created all 150 accounts and have assigned licenses, usage locations and numbers using this:
$data = Import-Csv "C:\Users\........Production.csv" -Delimiter "`t"
$Credential = Get-Credential
Connect-AzureAD -Credential $Credential
Connect-MicrosoftTeams -TenantId "TennantID" -Credential $Credential
foreach ($item in $data) {
# Collects values to set
$UPN = $item.UPN
$displayName = $item.DisplayName
$Phone = $item.PhoneNumber
$Country = $item.Country
if ($item.Type -ne "AA") {
$AppId = "11cd3e2e-fccb-42ad-ad00-878b93575e07" # CQ
} else {
$AppId = "ce933385-9390-45d1-9512-c8d228074e07" # AA
}
# Creates the ApplicationInstance object
$Object = New-CsOnlineApplicationInstance -UserPrincipalName $UPN -ApplicationId $AppId -DisplayName $displayName
# Waits for the user to exist
while ((Get-AzureADUser -ObjectId $UPN -ErrorAction SilentlyContinue) -eq $null) { sleep 50 }
# Assigns Usage Location
Set-AzureADUser -ObjectId $UPN -UsageLocation $Country
# Assigns the license
$License = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense
$License.SkuId = (Get-AzureADSubscribedSku |where {$_.skuPartNumber -eq "PHONESYSTEM_VIRTUALUSER" }).SkuId
$Licenses = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses
$Licenses.AddLicenses = $License
Set-AzureADUserLicense -ObjectId $UPN -AssignedLicenses $Licenses
# Waits for the license to be assigned
while (((Get-AzureADUser -ObjectId $UPN).AssignedPlans | where {($_.Service -eq "MicrosoftCommunicationsOnline") -and ($_.CapabilityStatus -eq "Enabled")}) -eq $null) {
write-host (get-date)
sleep 1
}
## Sets the phone number to the ApplicationInstance
#Set-CsOnlineApplicationInstance -Identity $Object.ObjectId -OnpremPhoneNumber $Phone
break
}
Disconnect-AzureAD
Jan 03 2022 06:10 AM
Jan 07 2022 03:33 AM