-
Notifications
You must be signed in to change notification settings - Fork 9
/
AzureADUser.ps1
35 lines (29 loc) · 889 Bytes
/
AzureADUser.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#Log into Azure
Connect-AzureAD
$domain = "arenamschamp.onmicrosoft.com"
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$PasswordProfile.Password = "agxsFX72xwsSAi"
#Find an existing user
Get-AzureADUser -SearchString "Istanbul"
Get-AzureADUser -Filter "City eq 'Istanbul'"
#Creating a new user
$user = @{
City = "Istanbul"
Country = "Turkey"
Department = "Information Technology"
DisplayName = "Haydar Pasa"
GivenName = "Haydar"
JobTitle = "IT Admin"
UserPrincipalName = "haydar.pasa@$domain"
PasswordProfile = $PasswordProfile
PostalCode = "34000"
State = "IST"
StreetAddress = "Haydar Pasa Caddesi"
Surname = "Pasa"
TelephoneNumber = "216-987-6544"
MailNickname = "Haydarpasa"
AccountEnabled = $true
UsageLocation = "TR"
}
$newUser = New-AzureADUser @user
$newUser | Format-List