question

manavalanR-1747 avatar image
0 Votes"
manavalanR-1747 asked amanpreetsingh-msft answered

How to create a user on azure active directory without login the azure

Hi all, for my requirement is little different i need to create an new user on AAD without login the azure cloud. I already researched how to do this and found that, by using hybrid environments, creating the AA DS and also windows server then added the AA DS to the windows server. But my scenario we don't want to use the windows server to do this.

azure-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered

Hi @manavalanR-1747 · Thank you for reaching out.

You can use Graph Explorer and use below call after signing in with user administrator or global administrator account:

Call:
POST https://graph.microsoft.com/v1.0/users

Body
{
"accountEnabled": true,
"displayName": "Adele Vance",
"mailNickname": "AdeleV",
"userPrincipalName": "AdeleV@contoso.onmicrosoft.com",
"passwordProfile" : {
"forceChangePasswordNextSignIn": true,
"password": "xWwvJ]6NMw+bWH-d"
}
}

Read more: https://docs.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http

To create guest users:

Call:
POST https://graph.microsoft.com/v1.0/invitations

Body:
{
"invitedUserEmailAddress": "yyy@test.com",
"inviteRedirectUrl": "https://myapp.contoso.com"
}

Read more: https://docs.microsoft.com/en-us/graph/api/invitation-post?view=graph-rest-1.0&tabs=http

To create users via PowerShell:

New-AzureADUser -DisplayName "New User" -PasswordProfile $PasswordProfile -UserPrincipalName "NewUser@contoso.com" -AccountEnabled $true -MailNickName "Newuser"

**Read more: **https://docs.microsoft.com/en-us/powershell/module/azuread/new-azureaduser?view=azureadps-2.0


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.