Created
July 23, 2019 20:12
-
-
Save arjancornelissen/bf6292aff81281af1423bb95ecdca70f to your computer and use it in GitHub Desktop.
Where-Object on large datasets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$msolusers = Get-MsolUser -All | Select-object ObjectId, WhenCreated, LastPasswordChangeTimestamp, @{n="mfaenabled";e={$_.StrongAuthenticationMethods.Count -gt 0}} | |
$users = Get-AzureADUser -All $true | Select-Object ObjectId, UserPrincipalName, DisplayName, @{n="onpremDN";e={$_.ExtensionProperty.onPremisesDistinguishedName}}, CompanyName, AccountEnabled, UserType | |
foreach($user in $users) | |
{ | |
$msoluser = $msolusers | where-object {$_.ObjectID -eq $user.ObjectID} | |
# do something with this data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment