Import-Module Microsoft.Graph.Authentication Import-Module Microsoft.Graph.Users # Connect with interactive browser auth Connect-MgGraph -TenantId 'ededa4fb-f6eb-4398-851d-5eb3e11fab27' -Scopes 'User.Read.All','User.ReadWrite.All','Directory.ReadWrite.All' -NoWelcome # Find both users $leslie = Get-MgUser -Filter "startsWith(displayName,'Leslie') or startsWith(mail,'leslie')" -Property DisplayName,Mail,UserPrincipalName,AccountEnabled,Id $barry = Get-MgUser -Filter "startsWith(displayName,'Barry') or startsWith(mail,'barry')" -Property DisplayName,Mail,UserPrincipalName,AccountEnabled,Id Write-Output '--- Leslie ---' $leslie | Format-List DisplayName,Mail,UserPrincipalName,AccountEnabled,Id Write-Output '--- Barry ---' $barry | Format-List DisplayName,Mail,UserPrincipalName,AccountEnabled,Id Disconnect-MgGraph