Forum Discussion
Melbatoast
May 08, 2024Copper Contributor
Migrating from Get-AzureADUser to Get-MgUser
I am attempting to replicate a Get-AzureADUser command using Get-MgUser. The previous command (Get-AzureADUser -Top 5000 | Where-Object {($.AccountEnabled -eq "True") -and (($.CompanyName -eq "CompA"...
- May 09, 2024The example above works just fine in PowerShell, too:
Get-MgUser -Filter "companyName ne null and (companyName eq 'ZZZ' or companyName eq 'YYY')" -ConsistencyLevel eventual -CountVariable count
Again, use consistencyLevel/count.
VasilMichev
May 09, 2024MVP
The example above works just fine in PowerShell, too:
Get-MgUser -Filter "companyName ne null and (companyName eq 'ZZZ' or companyName eq 'YYY')" -ConsistencyLevel eventual -CountVariable count
Again, use consistencyLevel/count.
Get-MgUser -Filter "companyName ne null and (companyName eq 'ZZZ' or companyName eq 'YYY')" -ConsistencyLevel eventual -CountVariable count
Again, use consistencyLevel/count.
Melbatoast
May 09, 2024Copper Contributor
Thank you! Adding the -CountVariable option worked. As for the other part of my question (which wound up weird because I think this site removed my fake email address and replaced it with a message), I'm not sure what happened a few days ago. Both commands now match.