&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Articles from September 2023 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2023/09/</link><description>Recent content in Articles from September 2023 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2023/09/index.xml" rel="self" type="application/rss+xml"/><item><title>PowerShell Escape Room</title><link>https://powershell.org/articles/2023-09-15-powershell-escape-room/</link><guid>https://powershell.org/articles/2023-09-15-powershell-escape-room/</guid><pubDate>Fri, 15 Sep 2023 16:42:26 +0000</pubDate><description>&lt;h1 id="powershell-escape-room-by-michiel-hamers" class="ps-heading"&gt;PowerShell Escape Room by Michiel Hamers&lt;a class="ps-heading-anchor" href="#powershell-escape-room-by-michiel-hamers" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;by Michiel Hamers&lt;br&gt;
&lt;a href="https://about.me/michielhamers/"&gt;https://about.me/michielhamers/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="why-on-earth-you-want-to-create-an-escape-room-with-powershell-as-backend" class="ps-heading"&gt;Why on earth you want to create an Escape Room with PowerShell as backend?&lt;a class="ps-heading-anchor" href="#why-on-earth-you-want-to-create-an-escape-room-with-powershell-as-backend" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve always been a fan of escape rooms, so I decided to create my own for my kids. I wanted to make it something that would be challenging and fun for them, but also educational. I decided to use PowerShell as the backend for the escape room, as I&amp;rsquo;m a PowerShell developer and I thought it would be a great way to learn more about the language.&lt;br&gt;
The first step was to design the rooms. I wanted to make sure that there were a variety of puzzles and challenges that my kids would have to solve. I also wanted to make sure that the rooms were visually appealing and engaging. Once I had the rooms designed, I started building them.&lt;br&gt;
I used a variety of materials to build the rooms, including wood, cardboard, and fabric. I also used a few electronic components, such as a USB extension cable with a switch and a 3-button keyboard. The USB extension cable with a switch was used to create a physical button that my kids could press to solve one of the puzzles. The 3-button keyboard was used to enter the code that my kids had to find to solve another puzzle.&lt;br&gt;
I also used a few websites to create rebus puzzles that my kids had to solve. I printed out the rebus puzzles and placed them around the rooms. Once my kids had solved all of the puzzles, they were able to enter the code on a single screen to escape the room.&lt;br&gt;
In this blog post, we&amp;rsquo;ll delve into the process of creating an engaging PowerShell escape room for the global PowerShell community. We&amp;rsquo;ll emphasize the significance of storytelling and provide a detailed breakdown of the PowerShell structure used for the escape room.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<h1 id="powershell-escape-room-by-michiel-hamers" class="ps-heading">PowerShell Escape Room by Michiel Hamers<a class="ps-heading-anchor" href="#powershell-escape-room-by-michiel-hamers" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>by Michiel Hamers<br><a href="https://about.me/michielhamers/">https://about.me/michielhamers/</a></p><h2 id="why-on-earth-you-want-to-create-an-escape-room-with-powershell-as-backend" class="ps-heading">Why on earth you want to create an Escape Room with PowerShell as backend?<a class="ps-heading-anchor" href="#why-on-earth-you-want-to-create-an-escape-room-with-powershell-as-backend" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I&rsquo;ve always been a fan of escape rooms, so I decided to create my own for my kids. I wanted to make it something that would be challenging and fun for them, but also educational. I decided to use PowerShell as the backend for the escape room, as I&rsquo;m a PowerShell developer and I thought it would be a great way to learn more about the language.<br>
The first step was to design the rooms. I wanted to make sure that there were a variety of puzzles and challenges that my kids would have to solve. I also wanted to make sure that the rooms were visually appealing and engaging. Once I had the rooms designed, I started building them.<br>
I used a variety of materials to build the rooms, including wood, cardboard, and fabric. I also used a few electronic components, such as a USB extension cable with a switch and a 3-button keyboard. The USB extension cable with a switch was used to create a physical button that my kids could press to solve one of the puzzles. The 3-button keyboard was used to enter the code that my kids had to find to solve another puzzle.<br>
I also used a few websites to create rebus puzzles that my kids had to solve. I printed out the rebus puzzles and placed them around the rooms. Once my kids had solved all of the puzzles, they were able to enter the code on a single screen to escape the room.<br>
In this blog post, we&rsquo;ll delve into the process of creating an engaging PowerShell escape room for the global PowerShell community. We&rsquo;ll emphasize the significance of storytelling and provide a detailed breakdown of the PowerShell structure used for the escape room.</p><h2 id="the-power-of-storytelling" class="ps-heading">The Power of Storytelling:<a class="ps-heading-anchor" href="#the-power-of-storytelling" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>&ldquo;Story is everything.&rdquo; This principle underpins the foundation of a successful escape room. Crafting an engaging and immersive story is crucial to captivate the participants and provide them with a memorable experience. For the PowerShell escape room, we&rsquo;ll design a narrative that centers around a critical mission, where participants must apply their PowerShell skills to overcome a series of challenges.</p><h2 id="the-powershell-escape-room-structure" class="ps-heading">The PowerShell Escape Room Structure:<a class="ps-heading-anchor" href="#the-powershell-escape-room-structure" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ol><li>The Controller - A Hub of Configuration: At the core of the escape room lies the &ldquo;controller&rdquo; PowerShell script. Acting as a central hub, this script offers menu options to configure various aspects of the escape room. From the number of rooms to the puzzles in each room and available hints, the controller script dynamically generates JSON files for each screen.</li><li>The Screen Scripts - Immersive Interaction: To create an interactive environment, individual PowerShell scripts are designated for each screen within the setup. Approximately nine screens are utilized, each responsible for a unique role. Upon startup, the screen script prompts the user to enter a screen number, enabling customized content based on the corresponding JSON configuration.</li><li>JSON Files for Puzzle Management: The puzzles, solutions, and hints are efficiently managed using JSON files. Quest files house the puzzles or rebus challenges, while hints are stored in separate JSON files, indicating the puzzle they refer to and the number of times they can be accessed.</li><li>Game State Management: To monitor the progress of the players and provide a seamless experience, a game state JSON file is employed. It keeps track of the number of completed rooms, solved puzzles, and hints used by the players. By resetting to a default template, the game state is restored whenever a reset is initiated.</li><li>Physical and Virtual Elements: To cater to a global audience, we&rsquo;ll blend physical and virtual elements in the escape room. Participants can interact with the virtual challenges via an online platform while engaging with tangible components, such as specially designed 3-key keyboards, for input on certain screens.</li></ol><h2 id="conclusion" class="ps-heading">Conclusion:<a class="ps-heading-anchor" href="#conclusion" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Creating the PowerShell escape room for my kids was an incredibly rewarding experience. As a PowerShell developer, I wanted to share my passion for the language in a fun and educational way. Watching my kids immerse themselves in the challenges, applying their problem-solving skills and learning more about PowerShell, filled me with joy.<br>
If you&rsquo;re considering creating your own PowerShell escape room, here are a few tips based on my experience:</p><ol><li>Make sure that the puzzles are both challenging and enjoyable, with an educational twist to enhance the learning experience.</li><li>Utilize a variety of materials to build the rooms, creating visually appealing and immersive environments.</li><li>Incorporate electronic components to add an interactive dimension to the escape room, making it even more engaging.</li><li>Explore websites to craft intriguing rebus puzzles that will intrigue and challenge your participants.</li><li>Print out the rebus puzzles and strategically place them around the rooms to ensure an exciting and dynamic gameplay.</li><li>Ensure that the code or answers your participants need to progress are cleverly hidden yet not overly difficult to find.<br>
Lastly, I&rsquo;m eager to connect with fellow enthusiasts who have also ventured into the world of PowerShell escape rooms or any other unique application of PowerShell. Let&rsquo;s share our experiences, ideas, and insights to create more thrilling adventures that celebrate our love for PowerShell and foster a strong community of like-minded individuals.</li></ol><p>Together, let&rsquo;s continue exploring the endless possibilities of PowerShell and inspire others to embrace its power and potential.<br><img src="https://powershell.org/wp-content/uploads/2023/09/image-1694796121959.png" alt="file"/>
]]></content:encoded></item><item><title>Microsoft Graph PowerShell Module: Getting Started Guide</title><link>https://powershell.org/articles/2023-09-15-microsoft-graph-powershell-module-getting-started-guide/</link><guid>https://powershell.org/articles/2023-09-15-microsoft-graph-powershell-module-getting-started-guide/</guid><pubDate>Fri, 15 Sep 2023 16:21:15 +0000</pubDate><description>&lt;h1 id="microsoft-graph-powershell-module-getting-started-guide" class="ps-heading"&gt;Microsoft Graph PowerShell Module: Getting Started Guide&lt;a class="ps-heading-anchor" href="#microsoft-graph-powershell-module-getting-started-guide" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;by Jeff Brown&lt;/p&gt;
&lt;p&gt;Microsoft is retiring the Azure AD Graph API sometime after June 30, 2023 (&lt;a href="https://techcommunity.microsoft.com/t5/microsoft-entra-azure-ad-blog/azure-ad-change-management-simplified/ba-p/2967456"&gt;announcement&lt;/a&gt;). This retirement includes the Azure AD PowerShell module. In its place, Microsoft has released the Microsoft Graph PowerShell module. The Microsoft Graph PowerShell module is the next-generation way of managing Microsoft cloud services using PowerShell. If you have used MSOnline or Azure AD PowerShell in the past, you&amp;rsquo;ll need to read on to learn about this new module.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<h1 id="microsoft-graph-powershell-module-getting-started-guide" class="ps-heading">Microsoft Graph PowerShell Module: Getting Started Guide<a class="ps-heading-anchor" href="#microsoft-graph-powershell-module-getting-started-guide" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>by Jeff Brown</p><p>Microsoft is retiring the Azure AD Graph API sometime after June 30, 2023 (<a href="https://techcommunity.microsoft.com/t5/microsoft-entra-azure-ad-blog/azure-ad-change-management-simplified/ba-p/2967456">announcement</a>). This retirement includes the Azure AD PowerShell module. In its place, Microsoft has released the Microsoft Graph PowerShell module. The Microsoft Graph PowerShell module is the next-generation way of managing Microsoft cloud services using PowerShell. If you have used MSOnline or Azure AD PowerShell in the past, you&rsquo;ll need to read on to learn about this new module.</p><p>In this tutorial, you will learn about the Microsoft Graph module, including how to authenticate, find cmdlet permissions, and upgrade from Azure AD PowerShell. To follow along with this tutorial, you will need either Windows PowerShell 5.1 or PowerShell 7. This tutorial uses PowerShell version 7.3.4.</p><h2 id="what-is-microsoft-graph" class="ps-heading">What is Microsoft Graph?<a class="ps-heading-anchor" href="#what-is-microsoft-graph" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Microsoft Graph is the entry point to all things Microsoft 365 and Azure. Microsoft Graph exposes REST APIs and client libraries so you can access data and manage resources in Microsoft 365, Enterprise Mobility + Security, and Dynamics 365. The Microsoft Graph API has a single endpoint (<a href="https://graph.microsoft.com">https://graph.microsoft.com</a>) that enables you to access data and build apps supporting any business need.</p><blockquote><p><strong>Related:<a href="https://jeffbrown.tech/getting-started-with-microsoft-teams-and-graph-api/">Jeff Brown Tech | Getting Started with Graph API</a></strong></p></blockquote><p>Some common uses for accessing Microsoft Graph include:</p><ul><li>Managing user accounts and licenses</li><li>Viewing and accessing files in OneDrive</li><li>Reading Outlook e-mail and calendar events</li><li>Managing Intune devices</li></ul><p>If you are new to REST APIs or just the Microsoft Graph, you can use Graph Explorer to try out different commands, including viewing your profile, managing groups, or working with Microsoft Teams. You can explore the sample tenant data or sign in to your Microsoft 365 account to view personalized responses.</p><p>Try out the Graph Explorer:</p><ol><li>Navigate to<a href="https://developer.microsoft.com/graph/graph-explorer">https://developer.microsoft.com/graph/graph-explorer</a>.</li><li>Select a pre-built query from the left menu, such as<strong>GET my profile</strong>.</li><li>Next, review the generated URL endpoint (<a href="https://graph.microsoft.com/v1.0/me">https://graph.microsoft.com/v1.0/me</a>).</li><li>Select the<strong>Run query</strong> button, then view the results under<strong>Response preview</strong>. You can make HTTP requests to Microsoft Graph to view and manage data like this!</li></ol><p><img src="https://powershell.org/wp-content/uploads/2023/09/graph_explorer_example-300x126.png" alt="Graph Explorer example"/><h2 id="microsoft-graph-powershell-module" class="ps-heading">Microsoft Graph PowerShell Module<a class="ps-heading-anchor" href="#microsoft-graph-powershell-module" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Cloud administrators have used the MSOnline and Azure AD PowerShell modules for managing Azure AD for years. The retirement of the Azure AD Graph API means Microsoft is also retiring those modules. The Microsoft Graph PowerShell module replaces the Azure AD PowerShell and MSOnline modules. The module is an API wrapper for accessing Microsoft Graph. The module contains cmdlets that interact with the Graph API using native PowerShell syntax. You don&rsquo;t have to worry about generating URLs or crafting search syntax; that is all included in the PowerShell commands.</p><p>Some features and benefits of the new modules are:</p><ul><li>Besides managing Azure AD, you can access other APIs, such as SharePoint, Exchange, Teams, and Outlook using a single endpoint.</li><li>Microsoft Graph PowerShell supports both Windows PowerShell 5.1 and PowerShell 7 (the Azure AD PowerShell module only supports Windows PowerShell 5.1).</li><li>The module works on multiple platforms, including Windows, macOS, and Linux.</li><li>Modern authentication support.</li><li>Open source with regular updates to support the latest Graph API changes.</li></ul><h3 id="installation" class="ps-heading">Installation<a class="ps-heading-anchor" href="#installation" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>To install the module on PowerShell 7, use the<code>Install-Module</code>command, specifying the<code>Name</code>of the module (<code>Microsoft.Graph</code>), and select a<code>Scope</code>for installation (<code>CurrentUser</code>or<code>AllUsers</code>).</p><p>`powershell</p><h1 id="install-for-current-user" class="ps-heading">Install for current user<a class="ps-heading-anchor" href="#install-for-current-user" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Install-Module -Name Microsoft.Graph -Scope CurrentUser</p><h1 id="install-for-all-users" class="ps-heading">Install for all users<a class="ps-heading-anchor" href="#install-for-all-users" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Install-Module -Name Microsoft.Graph -Scope AllUsers
`### API Version</p><p>By default, the module uses the Microsoft Graph REST API v1.0. You can also experiment with commands in the beta version by switching your API version. Use<code>Select-MgProfile</code>with the<code>Name</code>parameter to target the<code>Beta</code>version. If you want to switch batch to using v1.0 API commands, use<code>v1.0</code>for the<code>Name</code>parameter.</p><p>`powershell</p><h1 id="switch-to-beta" class="ps-heading">Switch to Beta<a class="ps-heading-anchor" href="#switch-to-beta" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Select-MgProfile -Name Beta</p><h1 id="switch-to-v10" class="ps-heading">Switch to v1.0<a class="ps-heading-anchor" href="#switch-to-v10" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Select-MgProfile -Name v1.0
`## Microsoft Graph PowerShell Authentication Types</p><p>The Graph PowerShell module supports two types of authentication: delegated and app-only. The following sections will explain the differences, and the remainder of this tutorial will focus on using delegated access.</p><h3 id="delegated-access" class="ps-heading">Delegated access<a class="ps-heading-anchor" href="#delegated-access" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Delegated access is when an application acts on behalf of a signed-in user. For example, you sign into an application, and the application calls the Microsoft Graph on your behalf. Both you and the application must be authorized to make requests to Microsoft Graph.</p><p>Delegated access requires delegated permissions, also known as scopes. Scopes represent the operations the application can perform on behalf of a user. You will see how scopes come into play later in this tutorial when you connect to the Microsoft Graph using PowerShell.</p><h3 id="app-only-access" class="ps-heading">App-only access<a class="ps-heading-anchor" href="#app-only-access" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>App-only access involves an application or service accessing Microsoft Graph without a signed-in user account. The application obtains an access token that includes information on what the application is authorized to access in the Microsoft Graph. An application calls the Microsoft Graph when assigned application permissions (or app roles) or when the application is an owner of the resources it needs to manage.</p><p>To use app-only access:</p><ol><li>Register an app with Azure AD.</li><li>Configure applicable Microsoft Graph permissions for the app.</li><li>Have an administrator grant the permissions.</li><li>Code the app to request an access token.</li><li>Use the access token and HTTP requests to call Microsoft Graph.</li></ol><p>For more information on using app-only access, check out the Microsoft Learn article<a href="https://learn.microsoft.com/graph/auth-v2-service">Get access without a user</a>.</p><h2 id="authenticating-to-microsoft-graph" class="ps-heading">Authenticating to Microsoft Graph<a class="ps-heading-anchor" href="#authenticating-to-microsoft-graph" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The remainder of this tutorial focuses on connecting to Microsoft Graph using delegated access. There are three ways to connect with delegated access using the<code>Connect-MgGraph</code>command.</p><ul><li><strong>Interactive authentication:</strong> A browser opens to authenticate to your tenant.</li></ul><p><code>powershell Connect-MgGraph</code>*<strong>Device authentication:</strong> Navigate to a URL and enter a device code to authenticate.</p><p><code>powershell Connect-MgGraph -UseDeviceAuthentication</code>*<strong>Access token:</strong> Authenticate using your own access token.</p><p><code>powershell Connect-MgGraph -AccessToken $AccessToken</code>After authentication, if this is your first time connecting to Microsoft Graph using PowerShell, a permission request window will appear. This prompt authorizes the Microsoft Graph Command Line Tools to act on your behalf. If you want to consent on behalf of your organization, check the box; otherwise, leave it unchecked and click<strong>Accept</strong>.</p><p><img src="https://powershell.org/wp-content/uploads/2023/09/graph_permissions_request.png" alt="Microsoft Graph permissions request"/><p>Once connected, PowerShell displays a<strong>Welcome to Microsoft Graph!</strong> message.</p><p><img src="https://powershell.org/wp-content/uploads/2023/09/welcome_message.png" alt="Microsoft Graph connection"/><h3 id="understanding-scopes" class="ps-heading">Understanding scopes<a class="ps-heading-anchor" href="#understanding-scopes" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Once connected, try running any command, such as<strong>Get-MgUser</strong>. This command should display user accounts in your tenant. However, you might be presented with an error message about insufficient privileges to complete the operation, like this:</p><p><img src="https://powershell.org/wp-content/uploads/2023/09/insufficient_privileges_error.png" alt="Microsoft Graph insufficient privileges"/><p>When connecting to Microsoft Graph using interactive or device code authentication, you must specify the permission scopes required during your session. Remember from earlier that scopes are the permissions the application performs on your behalf. With the Microsoft Graph PowerShell SDK, you specify what permissions you are granting it to carry out the commands.</p><p>You can view existing scopes for a session using<code>Get-MgContext</code>and viewing the<code>Scopes</code>property. In this example, the current context includes<code>openid, profile, User.Read, email</code>.</p><p><img src="./mgcontext_scopes.png" alt="Microsoft Graph context scopes"/><h3 id="finding-command-scopes" class="ps-heading">Finding command scopes<a class="ps-heading-anchor" href="#finding-command-scopes" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Now that you know you need to specify scopes in your connection, how do you find the necessary scopes for each command? You use the<code>Find-MgGraphCommand</code>and specify the<code>Command</code>parameter. Optionally, you can specify which<code>ApiVersion</code>you are using (currently<code>v1.0</code>or<code>beta</code>).</p><p>To view permissions more easily, pipe the results and expand just the<code>Permissions</code>property. Next, select just unique values for the permission<code>Name</code>property. Here are the command and results for finding permissions for<code>Get-MgUser</code>.</p><p><code>powershell Find-MgGraphCommand -Command "Get-MgUser" | Select-Object -ExpandProperty Permissions | Select-Object -Unique Name</code><img src="https://powershell.org/wp-content/uploads/2023/09/find_permissions_1.png" alt="Find Microsoft Graph command permissions"/><p>Many permissions allow you to list users; however, you don&rsquo;t have to specify every single one in your connect command. Choose one that makes the most sense. In this example, since you are getting information about user accounts, the<code>User.Read.All</code>scope seems most appropriate.</p><h3 id="adding-scopes-to-the-connection" class="ps-heading">Adding scopes to the connection<a class="ps-heading-anchor" href="#adding-scopes-to-the-connection" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Re-run the<code>Connect-MgGraph</code>command again, this time using the<code>Scopes</code>parameter with a value of<code>User.Read.All</code>. You will repeat the authentication and permission process from earlier.</p><p><code>powershell Connect-MgGraph -Scopes 'User.Read.All'</code>Re-running the<code>Get-MgUser</code>should now return a list of user accounts in your environment. This command works because you allowed the application to use the<code>User.Read.All</code>permission on your behalf.</p><p>As a bonus, re-run the<code>Get-MgContext</code>command and view the additional scope (hint: you may need to expand the<code>Scopes</code>property to view all the entries). You should see the<code>User.Read.All</code>scope added to your context.</p><p>As a challenge, say you want to update a user&rsquo;s display name using the<code>Update-MgUser</code>command. Use the previous steps to find and add the additional permission scopes to your connection.</p><p>To view all available application and delegated permissions, check out the<a href="https://learn.microsoft.com/graph/permissions-reference">Microsoft Graph permissions reference</a> article at Microsoft Learn.</p><h3 id="disconnecting-from-microsoft-graph" class="ps-heading">Disconnecting from Microsoft Graph<a class="ps-heading-anchor" href="#disconnecting-from-microsoft-graph" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Use the<code>Disconnect-MgGraph</code>command to disconnect from Microsoft Graph. Do note that<code>Disconnect-MgGraph</code>does not remove your scopes. The scopes added are included in your connection the next time you run<code>Connect-MgGraph</code>so you don&rsquo;t have to specify them again.</p><h2 id="upgrade-from-azure-ad-powershell" class="ps-heading">Upgrade from Azure AD PowerShell<a class="ps-heading-anchor" href="#upgrade-from-azure-ad-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>As previously mentioned, Microsoft is retiring the Azure AD, Azure AD Preview, and MSOnline PowerShell modules. The new Microsoft Graph PowerShell module replaces these modules for managing Azure AD and provides cmdlets for interacting with other Microsoft services.</p><p>If you have existing scripts, functions, or modules using the retiring modules, you need to review and document the commands and parameters you are using in them. Start with simpler scripts with lower business impact while developing a migration process. You will also need to determine if you need delegated or app-only access for authentication.</p><p>Microsoft provides documentation that maps cmdlets from Azure AD and MSOnline modules to the new Microsoft Graph module. Review the article at Microsoft Learn titled<a href="https://learn.microsoft.com/powershell/microsoftgraph/azuread-msoline-cmdlet-map">Find Azure AD and MSOnline cmdlets in Microsoft Graph PowerShell</a> for more information.</p><h2 id="summary" class="ps-heading">Summary<a class="ps-heading-anchor" href="#summary" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The Microsoft Graph PowerShell module is a powerful tool for managing not only Azure AD but many other Microsoft cloud services. You learned about installing the new module and the different authentication methods. Connecting to Microsoft Graph using PowerShell also requires defining your scoped permissions, and you learned how to find those scopes.</p><p>Additional reading about working with the new Microsoft Graph PowerShell module is below. Good luck and happy scripting!</p><p><a href="https://learn.microsoft.com/powershell/microsoftgraph/authentication-commands">Microsoft Learn | Authentication module cmdlets in Microsoft Graph PowerShell</a></p><p><a href="https://learn.microsoft.com/powershell/microsoftgraph/migration-steps">Microsoft Learn | Upgrade from Azure AD PowerShell to Microsoft Graph PowerShell</a></p>
]]></content:encoded></item></channel></rss>