Back to Browse

Block/Unblock user sign-in with Graph PowerShell SDK

52 views
Apr 28, 2024
4:13

This is a how-to video on how to block or unblock a user from signing into office 365 using Graph PowerShell SDK. Helpful KB's Microsoft Graph PowerShell overview https://learn.microsoft.com/en-us/powershell/microsoftgraph/overview?view=graph-powershell-1.0 Get started with the Microsoft Graph PowerShell SDK https://learn.microsoft.com/en-us/powershell/microsoftgraph/get-started?view=graph-powershell-1.0 Microsoft Graph Permission Explorer https://graphpermissions.merill.net/permission/ Module Information https://www.powershellgallery.com/packages/Microsoft.Graph/2.17.0 About admin roles in the Microsoft 365 admin center https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/about-admin-roles?view=o365-worldwide Prevent a former employee from logging in and block access to Microsoft 365 services https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/remove-former-employee-step-1?view=o365-worldwide Commands used during Video Find-MgGraphCommand -command Get-MgUser | Select -First 1 -Property Module Find-MgGraphCommand -command Get-MgUser | Select -First 1 -ExpandProperty Permissions Find-MgGraphCommand -command Update-MgUser | Select -First 1 -Property Module Find-MgGraphCommand -command Update-MgUser | Select -First 1 -ExpandProperty Permissions Import-Module -Name "Microsoft.Graph.Users" Connect-MgGraph –Scope "User.ReadWrite.All" Get-MgContext | Select-Object –ExpandProperty Scopes Get-MgUser -UserId "UPN of user account" -Property "displayName,accountEnabled" | Select-Object -Property DisplayName, AccountEnabled Update-MgUser -UserId "UPN of user account" -AccountEnabled:$FALSE Update-MgUser -UserId "UPN of user account" -AccountEnabled:$TRUE

Download

0 formats

No download links available.

Block/Unblock user sign-in with Graph PowerShell SDK | NatokHD