MicrosoftLearning / MD-102T00-Microsoft-365-Endpoint-Administrator

MIT License
51 stars 47 forks source link

References to MicrosoftOnline and AzureAd modules need to be changed #18

Closed craigbeeremct closed 7 months ago

craigbeeremct commented 1 year ago

From https://techcommunity.microsoft.com/t5/microsoft-entra-azure-ad-blog/microsoft-entra-change-announcements-september-2022-train/ba-p/2967454#:~:text=for%20Header%20keys.-,Azure%20AD%20Graph%20API,-Azure%20AD%20Graph

As we continue to support your migration efforts, we'll be extending the planned deprecation date of the three PowerShell Modules (Azure AD, Azure AD Preview, and MS Online) to June 30, 2023.

All references to those cmdlets will need to be updated to the new cmdlets (for example New-MgUser).

craigbeeremct commented 1 year ago

Something like the following:


Task - Create a user using PowerShell

Check Version

  1. Open PowerShell 7 as an administrator. This can be done by clicking the Start Menu, typing pwsh, right-clicking on PowerShell 7 (x64) and choosing Run As Administrator. Select Yes at the UAC prompt.

  2. If the PowerShell version is earlier than 7.2 then close the PowerShell 7 window and perform the following step. Otherwise skip to the next section.

  3. Open Microsoft Edge. Navigate to https://aka.ms/PowerShell-Release?tag=v7.3.1. Scroll down to the assets section and select powershell-7.3.1-win-x64.msi. When the download has completed, select Open file. Install using all the defaults.

Install the module

  1. In the administrative PowerShell 7 window, enter the following.

    Install-Module Microsoft.Graph -Scope CurrentUser
  2. If asked to confirm downloading from an untrusted repository then enter y.

  3. Close the administrative PowerShell 7 window.

Create a user

  1. Open PowerShell 7.

  2. Sign in to Azure by entering the folowing.

    Connect-MgGraph -Scopes "User.ReadWrite.All"
  3. When Microsoft Edge opens, sign in as MOD Administrator.

  4. At the Permissions requested page, enable Consent on behalf of your organization and then select Accept.

  5. Close the Microsoft Edge browser tab and return to PowerShell.

  6. Create a password profile object. Replace Pa55w.rdPa55w.rd with a complex password of your choice.

    $PWProfile = @{
        Password = "Pa55w.rdPa55w.rd";
        ForceChangePasswordNextSignIn = $false
    }
  7. Create a user. Replace labtenantname.com with the .onmicrosoft.com name assigned to your tenant.

    New-MgUser `
        -DisplayName "Rene Magi" `
        -GivenName "Rene" -Surname "Magi" `
        -MailNickname "renemagi" `
        -UsageLocation "NZ" `
        -UserPrincipalName "rene@labtenantname.com" `
        -PasswordProfile $PWProfile -AccountEnabled `
        -Department "Research" -JobTitle "Subject Matter Expert"