-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seems get-mtuser count argument is not working as intended as object returns more than count limited #626
Comments
maester/powershell/public/Get-MtUser.ps1 Line 85 in 45f12f2
maester/powershell/public/Get-MtUser.ps1 Line 120 in 45f12f2
maester/powershell/public/Get-MtUser.ps1 Line 136 in 45f12f2
It is just happening for Admin and BreakGlass/EmergencyAccess correct?
|
Get-MtUser.ps1 line 85, 120, 136, |
Yes correct, as far as I see the issue presents itself only for admin and bg accounts. |
I seems the count break should be in foreach otherwise has no effect.
foreach ( $EntraIDRole in $EntraIDRoles ) {
$TmpUsers = Invoke-MtGraphRequest -RelativeUri "directoryRoles/$ ($EntraIDRole.id)/members" -Select id, userPrincipalName, userType -OutputType Hashtable$TmpUsers.Count) users that are member of $ ($EntraIDRole.displayName)."
if ( $TmpUsers.ContainsKey('userType') ) {
Write-Verbose "Setting userType to Admin for $(
$TmpUsers | ForEach-Object {
$.userType = "Admin"
$Users.Add($) | Out-Null
# I put count check in loop
if ($Users.Count -ge $Count) {
Write-Verbose "Found $Count $UserType users."
break
}
}
<#
if ($Users.Count -ge $Count) {
Write-Verbose "Found $Count $UserType users."
break
}
#>
The text was updated successfully, but these errors were encountered: