Forum Discussion
What do I use to Connect to M365 and manage my users
Microsoft Graph PowerShell is the supported replacement for your MSOnline user-management scripts. Changing the login command alone is insufficient because cmdlet names, parameters and returned properties also differ. Start in PowerShell 7, which Microsoft recommends, rather than rebuilding the workflow around ISE. Install the user module with Install-Module Microsoft.Graph.Users -Scope CurrentUser. Connect using Connect-MgGraph -TenantId '<tenant-id>' -Scopes 'User.ReadUpdate.All'. Have an administrator approve the required consent, and use an account with an appropriate user-management role. Test Get-MgUser against one ordinary test account before changing anything. For example, Update-MgUser -UserId '<user-id>' -Department 'Finance' updates its department; read the property back to verify the result. Map each existing Msol command and parameter individually before running bulk changes. If an account is synchronized from on-premises Active Directory, check the source of authority for the property before attempting its cloud update.