Microsoft Entra ID Commands
Identity, sign-in, Conditional Access and app registrations in Microsoft 365 and Azure.All Microsoft Entra ID pages
- Get the last sign-in date of Microsoft Entra ID users with PowerShell (signInActivity)Get-MgUser -All -Property SignInActivity returns each Entra ID user's last sign-in. It needs AuditLog.Read.All, User.Read.All and a P1 or P2 license too.
- List the groups a Microsoft Entra ID user is a member of (Get-MgUserMemberOf)Get-MgUserMemberOfAsGroup -UserId UPN -All lists a user's Entra ID groups by name; the transitive cmdlet adds nested ones. Plain MemberOf hides DisplayName.
- Reset a Microsoft Entra ID user password with PowerShell (Update-MgUser -PasswordProfile)Reset an Entra ID password with Update-MgUser -PasswordProfile @{Password=...; ForceChangePasswordNextSignIn=$true}, using User-PasswordProfile.ReadWrite.All.
- Update-MgUser -AccountEnabled:$false: block sign-in for a Microsoft Entra ID userBlock sign-in for an Entra ID user with Update-MgUser -UserId UPN -AccountEnabled:$false. The colon matters: the parameter is a switch, so a space fails.