Thanks for the support, basically we are using the following script to export the required parameters into the CSV using Teams module 2.3.1, but the script is not working in 4.0.0,
It would be great if you can check and resolve the issue. I can run this script individually and get the output in 4.0.0, but when I run the complete script Script.Ps1 I get the following error.
Here is the error:
$transscriptname = "CallAgents" + (Get-Date ` -Format s).replace(":","-") +".txt"
Start-Transcript $transscriptname
$cq = Get-CsCallQueue -First 5000
$users = @()
foreach($q in $cq){$queueUsers = $q.Users
foreach($user in $queueusers){
$agent = Get-CsOnlineUser -Identity $user.Guid | Select UserPrincipalName, LineUri, SipAddress
$props = @{
QueueName = $q.Name
QueueID = $q.Identity
QueueRoutingMethod = $q.RoutingMethod
QueueAllowOptOut = $q.AllowOptOut
QueueConferenceMode = $q.ConferenceMode
QueuePresenceBasedRouting = $q.PresenceBasedRouting
UserPrincipalName = $agent.UserPrincipalName
LineUri = $agent.LineUri
SipAddress = $agent.SipAddress
}
$userObject = New-Object -TypeName PSObject -Property $props
$users += $userObject
}
}
$users | Export-Csv c:\CallQueueAgents.csv
Stop-Transcript
Thank you,
MS