Please see if the following script would work for you:
import-csv C:\temp\users.csv | foreach{ Get-CsOnlineUser $_.UPN } | Where-Object {$_.InterpretedUserType -eq "PureOnlineTeamsOnlyUser" -or $_.InterpretedUserType -eq "PureOnlineTeamsOnlyUserFailedPublishingToAAD"} | Sort-Object DisplayName
If (!($Users)) {Write-Host "No users found - exiting"; break }
$Report = [System.Collections.Generic.List[Object]]::new()
# Process each user to fetch their policy assignments
ForEach ($User in $Users) {
$TenantDefaultString = "Tenant Default"
$TeamsMeetingPolicy = $TenantDefaultString
$TeamsMessagingPolicy = $TenantDefaultString
$TeamsAppSetupPolicy = $TenantDefaultString
$TeamsAppPermissionsPolicy = $TenantDefaultString
$TeamsEncryptionPolicy = $TenantDefaultString
In the csv file you can use the following parameters:
- GUID
- SIP address
- UPN
- Alias
just make sure it matches this part:
foreach{ Get-CsOnlineUser $_.UPN}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.