forked from tomwechsler/Azure_Administrator_Associate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Create_Group.ps1
27 lines (18 loc) · 918 Bytes
/
Create_Group.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
Get-Command *az*user*
Get-Help New-AzADUser -detail
$SecureStringPassword = ConvertTo-SecureString -String 'Pa$$w0rdABC123' -AsPlainText -Force
New-AzADUser -DisplayName "Max Bishop" -UserPrincipalName "max.bishop@cloudgrid.site" -Password $SecureStringPassword -MailNickname "MBishop"
Get-AzADUser
Get-azaduser | select displayname
Get-azaduser -DisplayName "Max Bishop"
$upn = "max.bishop@cloudgrid.site"
$city = "Zurich"
Update-AzADUser -UPNOrObjectId $upn -City $city
(Show the city attribute in the portal GUI)
New-AzADGroup -DisplayName ProjectB_Members -MailNickname ProjectB_Members
Get-azadgroup | select displayname, id
(Copy the ID for ProjectB_Members)
$members = @()
$members += (Get-AzADUser -DisplayName "Jane Dodge").Id
$members += (Get-AzADUser -DisplayName "Janice Carter").Id
Add-AzADGroupMember -TargetGroupObjectID <Ihre Gruppen ID> -MemberObjectID $members