Introducing the Microsoft Entra PowerShell module (2024)

We’re thrilled to announce the public preview of the Microsoft Entra PowerShell module, a new high-quality and scenario-focused PowerShell module designed to streamline management and automation for the Microsoft Entra product family. In 2021, we announced that all our future PowerShell investments would be in the Microsoft Graph PowerShell SDK. Today, we’re launching the next major step on this journey. The Microsoft Entra PowerShell module (Microsoft.Graph.Entra) is a part of our ongoing commitment and increased investment in Microsoft Graph PowerShell SDK to improve your experience and empower automation with Microsoft Entra.

We’re grateful for the substantial feedback we’ve heard from Microsoft Entra customers about our PowerShell experiences, and we’re excited to hear your thoughts after evaluating this preview module. We plan to build on our investment in the Microsoft Entra PowerShell module going forward and expand its coverage of resources and scenarios.

What is Microsoft Entra PowerShell?

The Microsoft Entra PowerShell module is a command-line tool that allows administrators to manage and automate Microsoft Entra resources programmatically. This includes efficiently managing users, groups, applications, service principals, policies, and more. The module builds upon and is part of the Microsoft Graph PowerShell SDK. It’s fully interoperable with all cmdlets in the Microsoft Graph PowerShell SDK,enabling you to perform complex operations with simple, well-documented commands. The module also offers a backward compatibility option with the deprecated AzureAD module to accelerate migration. Microsoft Entra PowerShell supports PowerShell version 5.1 and version 7+. We recommend using PowerShell version 7 or higher with the Microsoft Entra PowerShell module on all platforms, including Windows, Linux, and macOS.

Benefits of Microsoft Entra PowerShell

  • Focus on usability and quality: Microsoft Entra PowerShell offers human-readable parameters, deliberate parameter set specification, inline documentation, and core PowerShell fundamentals like pipelining.
  • Backward compatibility with AzureAD module: Microsoft Entra PowerShell accelerates migration from the recently announced AzureAD module deprecation.
  • Flexible and granular authorization: Consistent with Microsoft Graph PowerShell SDK, Microsoft Entra PowerShell enables administrative consent for the permissions you want to grant to the application and supports specifying your own application identity for maximum granularity in app permission assignment. You can also use certificate, Service Principal, or Managed Identity authentication patterns.
  • Open source: The Microsoft Entra PowerShell module is open source, allowing contributions from the community to create great PowerShell experiences and share them with everyone. Open source promotes collaboration and facilitates the development of innovative business solutions. You can view Microsoft's customizations and adapt them to meet your needs.

Next steps

Installation: Install Microsoft Entra PowerShell, which uses the “/v1.0” API version to manage Microsoft Graph resources, from the PowerShell Gallery by running this command:

Install-Module Microsoft.Graph.Entra -AllowPrerelease -Repository PSGallery -Force

Or install the Beta module, which manages Microsoft Graph resources using the "/beta" API version, by running this command:

Install-Module Microsoft.Graph.Entra.Beta -AllowPrerelease -Repository PSGallery -Force

Authentication: Use the Connect-Entra command to sign in to Microsoft Entra ID with delegated access (interactive) or application-only access (noninteractive).

Connect-Entra -TenantId 'your-tenant-id' -Scopes 'User.Read.All'

To see more examples for using your own registered application, Service Principal, Managed Identity, and other authentication methods, see the Connect-Entra command documentation.

Find all available commands: You can list all available commands in the Microsoft Entra PowerShell module by using the command:

Get-Command -Module Microsoft.Graph.Entra

Get Help: The Get-Help command shows detailed information about specific commands, such as syntax, parameters, cmdlet description, and usage examples. For example, to learn more about the Get-EntraUser command, run:

Get-Help Get-EntraUser -Full

Migrating from AzureAD PowerShell module: You can run your existing AzureAD PowerShell scripts with minimal modifications using Microsoft Entra PowerShell by using the Enable-EntraAzureADAlias command. For example:

Import-Module -Name Microsoft.Graph.Entra

Connect-Entra #Replaces Connect-AzureAD for auth

Enable-EntraAzureADAlias #enable aliasing

Get-AzureADUser -Top 1

Frequently Asked Questions (FAQs)

What is the difference between the Microsoft Graph PowerShell SDK and Microsoft Entra PowerShell modules?

Microsoft Entra PowerShell is a part of our increased investment in Microsoft Graph PowerShell SDK. It brings high-quality and scenario-optimized Entra resource management to the Microsoft Graph PowerShell SDK. Still, it keeps all the benefits of Microsoft Graph PowerShell SDK for authorization, connection management, error handling, and (low-level) API coverage. As Microsoft Entra PowerShell builds on the Microsoft Graph PowerShell SDK, it is completely interoperable.

Is the Microsoft Entra PowerShell module compatible with Microsoft Graph PowerShell?

Yes. You don't need to switch if you’ve already used the Microsoft Graph PowerShell module. Both modules work well together, and whether you use Entra module cmdlets or Microsoft Graph PowerShell SDK cmdlets for Entra resources is a matter of preference.

I need to migrate from the deprecated AzureAD or MSOnline modules. Should I wait for Microsoft Entra PowerShell?

No. One of our goals with Microsoft Entra PowerShell is to help you migrate from Azure AD PowerShell more quickly by setting Enable-EntraAzureADAlias. Microsoft Entra PowerShell supports simplified migration for scripts that were using AzureAD PowerShell, with over 98% compatibility. However, the legacy AzureAD and MSOnline PowerShell modules are deprecated and will be retired (stop working) after March 30, 2025. We recommend that you act now to begin migrating your MSOnline and AzureAD PowerShell scripts.

Both modules use the latest Microsoft Graph APIs. For test environments and non-production systems, you can migrate to Microsoft Entra PowerShell. We recommend migrating to this module for production systems only after it reaches general availability. If you migrate scripts to Microsoft Graph PowerShell SDK now, there is no need to update them again with Microsoft Entra PowerShell, as it enhances and will not replace Microsoft Graph PowerShell SDK.

Should I update Microsoft Graph PowerShell scripts to Microsoft Entra PowerShell?

This is not necessary but a matter of preference. Microsoft Entra PowerShell is part of the Microsoft Graph PowerShell solution, and the two modules are interoperable. You can install both modules side-by-side.

Will Microsoft Entra PowerShell add support for more resources in the future?

Yes, it is a long-term investment. We will continue to expand support for more resources and scenarios over time. Expect new cmdlets for Privileged Identity Management (PIM), Entitlement Management, Tenant Configuration settings, Per-User multifactor authentication (MFA), and more. We'll also enhance existing cmdlets with additional parameters, detailed help, and intuitive names. Check out GitHub repo for ongoing updates.

Will Microsoft Entra PowerShell use a pre-consented app like AzureAD or MSOnline modules?

No. Microsoft Entra PowerShell permissions aren't preauthorized, and users must request the specific app permissions needed. This granularity ensures that the application has only the necessary permissions, providing granular control over resource management. For maximum flexibility and granularity in application permissions, we recommend using your own application identity with Entra PowerShell. By creating different applications for different uses of PowerShell in your tenant, you can have exacting control over application permissions granted for specific scenarios. To use your own application identity with Microsoft Entra PowerShell, you can use the Connect-Entra cmdlet:

Connect-Entra -ClientId 'YOUR_APP_ID' -TenantId 'YOUR_TENANT_ID'

I am new to Microsoft Entra PowerShell; where do I start?

Explore our public documentation to learn how to install the Microsoft Entra PowerShell module, authenticate, discover which cmdlet to use for a particular scenario, read how-to guides, and more. Our best practice guide will help you start on a secure foundation.

How can I provide feedback?

You can provide feedback by visiting our GitHub repository issues section. Create a new issue with your feedback, suggestions, or any problems you've encountered. Our team actively monitors and responds to feedback to improve the module.

How can I contribute?

We welcome contributions from the community, whether it's through submitting bug reports, suggesting new features, or contributing scenario and example improvements. To get started, visit the GitHub repository, check out our contribution guidelines, and create a pull request with your changes.

Learn more about Microsoft Entra PowerShell module

Explore our public documentation, to learn how to install the Microsoft Entra PowerShell module, the authentication methods available, which cmdlet to use for a particular scenario, how-to guides, and more.

Try It Today

Try out the new version and let us know what you think on GitHub! Your insights are invaluable as we continue to improve and enhance the module to better meet your needs.

Thank you!

We want to thank all the community members who helped us improve this release by reporting issues on GitHub during the private preview! Please keep them coming!

Steve Mutungi

Product Manager, Microsoft Entra PowerShell

Read more on this topic

Learn more about Microsoft Entra

Prevent identity attacks, ensure least privilege access, unify access controls, and improve the experience for users with comprehensive identity and network access solutions across on-premises and clouds.

  • Microsoft Entra News and Insights | Microsoft Security Blog
  • ⁠⁠Microsoft Entra blog | Tech Community
  • Microsoft Entra documentation | Microsoft Learn
  • Microsoft Entra discussions | Microsoft Community
Introducing the Microsoft Entra PowerShell module (2024)


Introducing the Microsoft Entra PowerShell module? ›

The Microsoft Entra PowerShell module is a command-line tool that allows administrators to manage and automate Microsoft Entra resources programmatically. This includes efficiently managing users, groups, applications, service principals, policies, and more.

Is the Azure AD PowerShell module deprecated? ›

Azure AD and MSOnline PowerShell modules are deprecated as of March 30, 2024. To learn more, read the deprecation update). After this date, support for these modules are limited to migration assistance to Microsoft Graph PowerShell SDK and security fixes.

Is MSOnline deprecated? ›

As of March 30, 2024, Microsoft has deprecated three PowerShell modules: AzureAD, Azure AD Preview, and MSOnline.

How do I create a new module in PowerShell? ›

Add your local folder as a PowerShell Gallery:
  1. Mkdir <module name> ...
  2. Copy the PSM1 file to the <module name> directory.
  3. Create the manifest (.psd1) file, example: ...
  4. Edit the manifest psd1 file, uncomment and provide values for the following required properties:

How do I get loaded PowerShell modules? ›

The Get-InstalledModule cmdlet gets PowerShell modules that are installed on a computer using PowerShellGet. To see all modules installed on the system, use the Get-Module -ListAvailable command.

Is Microsoft moving away from PowerShell? ›

As of March 30, 2024, Azure AD, Azure AD Preview, and MS Online PowerShell modules are deprecated.

What is the difference between PowerShell module Azure and AZ? ›

The Az PowerShell module is the replacement for AzureRM and is the recommended module to use for interacting with Azure. The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

What is the difference between Msol and AzureAD? ›

Get-AzureAD: allows user to manage Active Directory objects only, [where directory is hosted in Azure]. Get-MSOL: apart from managing Active Directory allows more administrative tasks such as Domain management, configure single sign-on etc.

How to connect MsolService PowerShell? ›

How to Use Connect-MSolservice
  1. Step 1: Open a PowerShell Session and Install MSOnline. First, we need to connect to the MSOnline module from PowerShell. ...
  2. Step 2: Run the Connect-MsolService Cmdlet. Now, after installing the module, it's time to run the Connect-MsolService. ...
  3. Step 3: Complete Microsoft Account Authentication.
Jan 25, 2024

How to connect Azure AD PowerShell? ›

How to Connect to Azure AD using PowerShell?
  1. Step 1: Install the Azure AD PowerShell Module. ...
  2. Step 2: Connect to Azure AD using Connect-AzureAD cmdlet. ...
  3. Step 3: Start using cmdlets from the Azure AD PowerShell Module.
Jun 5, 2024

What is the difference between a PowerShell script and a module? ›

PowerShell modules allow you to combine multiple scripts to simplify code management, accessibility and sharing. Scripts are useful. However, they can become unwieldy over time as you create more and more of them. Modules allow you to combine script collections into cohesive units.

What is the best practice to create a module in PowerShell? ›

The best practice to create a module manifest is to use the New-ModuleManifest cmdlet. You can use parameters to specify one or more of the manifest's default keys and values. The only requirement is to name the file.

Why use a PowerShell module? ›

By defining a set of related script files, assemblies, and related resources as a module, you can reference, load, persist, and share your code much easier than you would otherwise. The main purpose of a module is to allow the modularization (ie, reuse and abstraction) of Windows PowerShell code.

What are the different types of PowerShell modules? ›

There are three different module types: manifest, script, and binary. A manifest module is a file that contains information about a module, and controls certain aspects of that module's use. A script module is a PowerShell script file with a file extension of . psm1 instead of .

Where do PowerShell modules get stored? ›

These modules are stored in the $PSHOME\Modules folder. On Windows, modules installed in the AllUsers scope are stored in $env:ProgramFiles\WindowsPowerShell\Modules . On non-Windows systems, modules installed in the AllUsers scope are stored in /usr/local/share/powershell/Modules .

How do I list all commands in the PowerShell module? ›

The Get-Command cmdlet gets all commands that are installed on the computer, including cmdlets, aliases, functions, filters, scripts, and applications. Get-Command gets the commands from PowerShell modules and commands that were imported from other sessions.

Is PowerShell 2.0 deprecated? ›

Windows PowerShell 2.0 was deprecated in August, 2017. For more information, see the announcement on the PowerShell blog. Windows PowerShell 2.0 is missing a significant amount of the hardening and security features added in versions 3, 4, and 5. We highly, highly recommend that users not use it if they can help it.

Is Azure Active Directory deprecated? ›

Azure Active Directory (Azure AD) Graph is deprecated and is in its retirement path.

What versions of Azure AD Connect are deprecated? ›

On August 31, 2022, all 1. x versions of Azure Active Directory (Azure AD) Connect will be retired because they include SQL Server 2012 components that will no longer be supported. Please upgrade to the latest release of Azure AD Connect version 2. x or Azure AD Connect cloud sync.

How do I update my Azure PowerShell module? ›

The Update-Module cmdlet installs a module's newest version from an online gallery. You're prompted to confirm the update before it's installed. Updates are installed only for modules that were installed on the local computer with Install-Module . Update-Module searches $env:PSModulePath for installed modules.


Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6362

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.