Skip to content

Commit 144988d

Browse files
authored
Merge pull request #17440 from TimShererWithAquent/us402106-11
368370 PowerShell rebrand
2 parents 791c6ed + e515908 commit 144988d

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

azure-stack/operator/azure-stack-add-new-user-aad.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to create a user account in Microsoft Entra ID, so you ca
44
author: sethmanheim
55
ms.topic: article
66
ms.custom:
7-
- has-azure-ad-ps-ref
7+
- no-azure-ad-ps-ref
88
ms.date: 08/15/2024
99
ms.author: sethm
1010
ms.reviewer: thoroet
@@ -46,41 +46,27 @@ You must have an Azure subscription to use the Azure portal.
4646

4747
## Create a user account using PowerShell
4848

49-
If you don't have an Azure subscription, you can't use the Azure portal to add a tenant user account. In this case, you can use the Azure AD module for Windows PowerShell instead.
49+
If you don't have an Azure subscription, you can't use the Azure portal to add a tenant user account. In this case, you can use the Microsoft Graph module for Windows PowerShell instead.
5050

51-
[!INCLUDE [Azure AD PowerShell deprecation note](~/../azure-stack/reusable-content/msgraph-powershell/includes/aad-powershell-deprecation-note.md)]
52-
53-
1. Install the Microsoft Azure AD module for Windows PowerShell with these steps:
51+
1. Install the Microsoft Graph PowerShell SDK for Windows PowerShell with these steps:
5452

5553
- Open an elevated Windows PowerShell command prompt (run Windows PowerShell as admin).
56-
- Run the **Install-Module AzureAD** command.
54+
- Run the **Install-Module Microsoft.Graph** command.
5755
- If you're prompted to install the NuGet provider, select **Y** and **Enter**.
5856
- If you're prompted to install the module from PSGallery, select **Y** and **Enter**.
5957

60-
1. Run the following cmdlets to sign in and create the user account:
61-
62-
- If your directory **doesn't require** multi-factor authentication, use this sequence to authenticate:
63-
64-
```powershell
65-
# Wait for the prompt, then sign in using your Azure AD credentials
66-
$aadcred = get-credential
67-
Connect-AzureAD -credential $aadcred
68-
```
69-
70-
- If your directory **requires** multi-factor authentication, use this sequence to authenticate:
58+
1. Run the following cmdlet to connect.
7159

7260
```powershell
73-
# Wait for the prompt, then sign in using your Azure AD credentials and MFA code
74-
Connect-AzureAD -Confirm
61+
Connect-MgGraph -Scopes 'User.ReadWrite.All'
7562
```
7663

77-
- Now that you've authenticated, complete the sequence by adding the new user:
64+
1. After you connect, complete the sequence by adding the new user:
7865

7966
```powershell
8067
# Create the new user account (be sure to replace all <placeholder> values first)
81-
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
82-
$passwordProfile.Password = "<Password>"
83-
New-AzureADUser -DisplayName "<UserName>" -PasswordProfile $passwordProfile -UserPrincipalName "<username>@<yourdomainname>" -AccountEnabled $true -MailNickName "<MailNickName>"
68+
$PasswordProfile = @{ Password = '<password>' }
69+
New-MgUser -DisplayName "<UserName>" -PasswordProfile $passwordProfile -UserPrincipalName "<username>@<yourdomainname>" -MailNickName "<MailNickName>" -AccountEnabled
8470
```
8571

8672
1. Sign in to the [Azure portal](https://portal.azure.com) with the new user account. Change the password when prompted.

0 commit comments

Comments
 (0)