Forum Discussion
Assign Resource Account to CallQueue or AutoAttendant (Powershell)
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,
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
- MigelusJan 03, 2022Copper Contributorhey Ivan,
this command is quite old, and my understanding is:
unless dns
_sip._tls.yourdomain.com doesn't point to sipdir.online.lync.com
you cant create pureonline accnts Email address removed, you can create only Email address removed
so when did you made DNS change? before or after creating pureonline accnts?
cheers,- IvanAnevJan 07, 2022Copper ContributorHello, DNS changes have been made 3 weeks after creating the accounts and the AA and CQ were working during that time with the new cloud resource accounts. Skype for Business server was decommissioned by NOT following the Microsoft guide, as if we have followed it, there would have been a serious outage. 5 tickets raised with Microsoft, 1 Fast Track and nobody knew why it was working 🙂 It still works now, so there is no problem at all.