-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy path13_Add_RBAC_User.ps1
40 lines (21 loc) · 1.28 KB
/
13_Add_RBAC_User.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
36
37
38
39
40
Set-Location C:\
Clear-Host
Install-Module -Name Az -AllowClobber -Scope AllUsers
# Connect to Azure with a browser sign in token
Connect-AzAccount
Get-AzRoleDefinition | FT Name, Description
Get-AzRoleDefinition "Owner"
Get-AzRoleDefinition "Owner" | ConvertTo-Json
Get-AzRoleDefinition "Contributor" | FL Actions, NotActions
(Get-AzRoleDefinition "Virtual Machine Contributor").Actions
Get-AzRoleAssignment
Get-AzRoleAssignment -SignInName [email protected] | FL DisplayName, RoleDefinitionName, Scope
Get-AzRoleAssignment -SignInName [email protected] -ExpandPrincipalGroups | FL DisplayName, RoleDefinitionName, Scope
Get-AzRoleAssignment -ResourceGroupName tw-web-rg | FL DisplayName, RoleDefinitionName, Scope
Get-AzSubscription
Get-AzRoleAssignment -Scope /subscriptions/<ihre Subscription ID>
Get-AzRoleAssignment -IncludeClassicAdministrators
Get-AzADUser -StartsWith 'tom'
New-AzRoleAssignment -SignInName [email protected] -RoleDefinitionName "Virtual Machine Contributor" -ResourceGroupName tw-web-rg
Get-AzRoleAssignment -SignInName [email protected] | FL DisplayName, RoleDefinitionName, Scope
Remove-AzRoleAssignment -SignInName [email protected] -RoleDefinitionName "Virtual Machine Contributor" -ResourceGroupName tw-web-rg