Table of Contents
After Microsoft announced the deprecation of PowerShell modules, such as Azure AD and MS Online, the MS Graph PowerShell modules gained attention from admins. However, the Microsoft Graph module might not provide all the necessary attribute values or properties. So, admins utilize the beta profile of the PowerShell module to fulfill them.
But, with the Graph PowerShell module’s update to version 2.0, Microsoft separated the beta from the standard one and launched it as a separate module called Microsoft Graph beta. Let’s explore the detailed process to install Microsoft Graph beta module in Windows PowerShell.
Installing Microsoft Graph Beta Module
As a Microsoft 365 admin, you’re probably familiar with the significance of Microsoft Graph in managing your organization’s data and resources efficiently. However, did you know there’s even more to explore with the beta version?
Let’s take a practical example: When using the Get-MgUser cmdlet in MS Graph PowerShell, you can effortlessly retrieve user details. Yet, for certain critical properties like UserType, AccountType, and AssignedLicense, there’s a slight twist – you require the beta module.
You might be wondering, Why should I opt for the beta module when I can switch to the beta profile?
However, the crucial answer lies in the fact that you need to install Microsoft Graph beta module for the following reasons.
- When you upgrade your MS Graph PowerShell module to version 2.0 or later, attempting to use the Select-MGProfile Beta cmdlet will result in displaying an error message stating the term select mgprofile is not recognized. To overcome this, you have to install a separate module for the beta version.
- By default, during the installation of Graph PowerShell for the first time, the latest version is usually installed. In such cases, you need to install the Microsoft Graph beta module to access beta capabilities.
- Additionally, with the beta module’s installation, you can effortlessly access the beta features, making it easier compared to switching to the beta profile each time. In this scenario, you can install and work with the beta module without updating the existing standard Graph module.
You can install Microsoft Graph beta module for the currently logged-in user by running the below cmdlet in Windows PowerShell. This installs the latest version, if you want to install it with the specific Microsoft Graph beta version use the RequiredVersion parameter.
Install-Module Microsoft.Graph.Beta -Scope CurrentUser
You can also change the scope of the installation to AllUsers using the Scope parameter as described in the below cmdlet. Execution of the below cmdlet requires admin permissions (PowerShell- Run as administrator).
Install-Module Microsoft.Graph.Beta -Scope AllUsers
Once done, you can check the installed version of Microsoft Graph Beta module.
PS C:\> Get-InstalledModule Microsoft.Graph.Beta Version Name Repository Description ------- ---- ---------- ----------- 2.4.0 Microsoft.Graph.Beta PSGallery Microsoft Graph PowerShell module
Connect to Microsoft Graph Beta
First, you have to connect Microsoft Graph PowerShell to experience the beta features and benefits.
PS C:\> Connect-MgGraph Welcome to Microsoft Graph! Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e Readme: https://aka.ms/graph/sdk/powershell SDK Docs: https://aka.ms/graph/sdk/powershell/docs API Docs: https://aka.ms/graph/docs NOTE: You can use the -NoWelcome parameter to suppress this message.
After connection, it is necessary to use the prefix Beta with cmdlets that utilize the beta module. For example, Get-MgBetaUser instead of Get-MgUser and Get-MgBetaGroup instead of Get-MgGroup.
PS C:\> Get-MgBetaUser -Top 5 DisplayName Id Mail UserPrincipalName ----------- -- ---- ----------------- Adele Vance cd90a87a-7156-4f6a-88b5-5ee908354b3c [email protected] [email protected] MOD Administrator 647fea69-afca-4001-af45-f0cc82a2fa41 [email protected] [email protected] Alex Wilber a1ae71c5-a099-4368-8c9f-c1e24cb027fc [email protected] [email protected] Allan Deyoung 19d877b4-b2f8-456d-ad26-766dec8f5d74 [email protected] [email protected] Automate Bot 7a8b00ac-6c46-48b3-bc0e-4fc0b20be29b [email protected] [email protected]
Update the Graph PowerShell Beta Module
If you already have installed the PowerShell beta module and wish to update it to the latest version, use the following cmdlet.
Uninstall Microsoft Graph SDK Beta PowerShell
To uninstall Microsoft Graph beta module and remove all the dependency modules of the Microsoft Graph beta, you can make use of the below cmdlets.
Uninstall-Module Microsoft.Graph.Beta -AllowPrerelease -AllVersions Get-InstalledModule Microsoft.Graph.Beta* | Uninstall-Module