🔧 New: User Management Graph PowerShell Toolkit

Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.

🚀 Launch Toolkit

Automate Microsoft 365 User Management With Graph PowerShell

Managing Microsoft 365 users manually can be time-consuming, error-prone, and inefficient—especially as your organization grows. Fortunately, with Microsoft Graph PowerShell, you can automate common user management tasks and save valuable admin hours.

This blog post will walk you through the why, how, and what of automating Microsoft 365 user management—along with a ready-to-use script that you can tweak for your environment.


Why Automate Microsoft 365 User Management?

IT admins are often overwhelmed with repetitive user tasks—adding new hires, updating user info, disabling accounts, or assigning licenses. Doing these actions one by one through the portal may work for small teams, but it's not scalable for large organizations.

Automation ensures:

  • Consistency across user operations
  • Time savings through batch execution
  • Reduced human error
  • Improved onboarding/offboarding workflows
  • Better auditability and compliance

How to Automate Microsoft 365 User Management Using Graph PowerShell

Microsoft Graph PowerShell provides a modern and secure way to interact with Microsoft 365 services—including users, groups, licenses, calendars, and more.

By leveraging Graph PowerShell, you can script and automate operations such as:

  • Fetching and listing users
  • Adding a new user
  • Updating user attributes (e.g., display name, department)
  • Deleting (removing) users
  • Enabling or disabling user accounts
  • Assigning or removing Microsoft 365 licenses

These actions are done using a set of Get-, New-, Set-, and Remove- cmdlets from the Microsoft.Graph module—offering full control from the command line.


Benefits of Automating User Management

Here’s why automating user management is a no-brainer for admins:

  • 🔁 Streamline repetitive tasks: Save hours each week
  • 🧾 Ensure compliance: Maintain accurate and timely records
  • 📥 Accelerate onboarding: Create and configure accounts in seconds
  • 🗂️ Support bulk operations: Easily scale across departments or regions
  • 🔒 Improve security: Promptly disable users no longer with the org

Whether you're running weekly cleanups or daily user onboarding, a well-built automation script can drastically reduce your workload.


Graph PowerShell for Automating User Management

We've created a comprehensive Graph PowerShell script that covers the six most common user management actions:

  • Fetch Users
  • Use Get-MgUser to list all or specific users from your tenant.

  • Add a New User
  • Create users using New-MgUser, with custom attributes such as job title, department, and license configuration.

  • Update User Details
  • Modify attributes like display name, city, or usage location using Update-MgUser.

  • Remove a User
  • Use Remove-MgUser to delete deactivated or test users in bulk or individually.

  • Enable/Disable User Account
  • Control sign-in access by setting the AccountEnabled property.

  • Assign or Remove Licenses
  • Use Set-MgUserLicense to assign new service plans or remove unnecessary ones.


👉 Here’s the full step-by-step script that you can use and customize for your organization:

🔗 Manage Microsoft 365 Users With Graph PowerShell

This script provides a menu-driven approach to manage users. You can easily extend it to support CSV imports, logging, conditional logic, or schedule it via task automation tools. You can check out how the script operates using this GIF.


Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.

Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.

© Your Site Name. All Rights Reserved. Design by HTML Codex