Skip to content

Commit 0a9db56

Browse files
author
Taofeek F. Obafemi-Babatunde
authored
Merge branch 'dev' into FehintolaObafemi/permission
2 parents 21c50f3 + 815bae2 commit 0a9db56

32 files changed

+284
-424
lines changed
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Create a new application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
New-MgApplication -DisplayName 'New app' |
5+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
6+
7+
Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309
8+
DisplayName : New app
9+
AppId : c678b75d-1012-4466-8655-1672192232b4
10+
SignInAudience : AzureADandPersonalMicrosoftAccount
11+
PublisherDomain : M365B977454.onmicrosoft.com
1512
```
1613

17-
{{ Add description here }}
18-
14+
This example creates a new application.
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Add an owner to an application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$NewOwner = @{
5+
"@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}"
6+
}
137
14-
{{ Add output here }}
8+
New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner
159
```
1610

17-
{{ Add description here }}
18-
11+
In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application.
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Create a new service principal object
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$ServicePrincipalID=@{
5+
"AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62"
6+
}
7+
New-MgServicePrincipal -BodyParameter $ServicePrincipalId |
8+
Format-List id, DisplayName, AppId, SignInAudience
139
14-
{{ Add output here }}
10+
Id : ac483a5f-f291-4499-8a62-058547724579
11+
DisplayName : Example App
12+
AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec
13+
SignInAudience : AzureADandPersonalMicrosoftAccount
1514
```
1615

17-
{{ Add description here }}
18-
16+
In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Assign a user an application role
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
5+
-PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
6+
-ResourceId '0873169c-9595-4664-9d02-499b49846ff1' `
7+
-AppRoleID '00000000-0000-0000-0000-000000000000' |
8+
Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName,
9+
PrincipalId, PrincipalType, ResourceDisplayName, ResourceId
1310
14-
{{ Add output here }}
11+
Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI
12+
AppRoleId : 00000000-0000-0000-0000-000000000000
13+
PrincipalDisplayName : Adele Vance
14+
PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01
15+
PrincipalType : User
16+
ResourceDisplayName : dxprovisioning-analytics
17+
ResourceId : 0873169c-9595-4664-9d02-499b49846ff1
1518
```
1619

17-
{{ Add description here }}
18-
20+
This commands assigns the specified user a role in the specified application resource.
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Remove a user's application role assignment
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
Remove-MgUserAppRoleAssignment `
5+
-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' `
6+
-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01'
157
```
168

17-
{{ Add description here }}
18-
9+
This example removes the specified application role from the specified user.
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Update an application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
Update-MgApplication `
5+
-ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' `
6+
-DisplayName 'Testing App'
157
```
168

17-
{{ Add description here }}
18-
9+
This example updates the specified application's display name.
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Update the properties of a service principal
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$ServicePrincipalUpdate =@{
5+
"accountEnabled" = "true"
6+
"appRoleAssignmentRequired" = "true"
7+
}
138
14-
{{ Add output here }}
9+
Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate
1510
```
1611

17-
{{ Add description here }}
18-
12+
This is example, the first command defines the properties and their values in a hashtable under the variable $ServicePrincipalUpdate. The second command updates the specified service principal.
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Create a new application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
New-MgApplication -DisplayName 'New app' |
5+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
6+
7+
Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309
8+
DisplayName : New app
9+
AppId : c678b75d-1012-4466-8655-1672192232b4
10+
SignInAudience : AzureADandPersonalMicrosoftAccount
11+
PublisherDomain : M365B977454.onmicrosoft.com
1512
```
1613

17-
{{ Add description here }}
18-
14+
This example creates a new application.
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Add an owner to an application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$NewOwner = @{
5+
"@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}"
6+
}
137
14-
{{ Add output here }}
8+
New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner
159
```
1610

17-
{{ Add description here }}
18-
11+
In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application.
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Create a new service principal object
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$ServicePrincipalID=@{
5+
"AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62"
6+
}
7+
New-MgServicePrincipal -BodyParameter $ServicePrincipalId |
8+
Format-List id, DisplayName, AppId, SignInAudience
139
14-
{{ Add output here }}
10+
Id : ac483a5f-f291-4499-8a62-058547724579
11+
DisplayName : Example App
12+
AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec
13+
SignInAudience : AzureADandPersonalMicrosoftAccount
1514
```
1615

17-
{{ Add description here }}
18-
16+
In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Assign a user an application role
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
5+
-PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
6+
-ResourceId '0873169c-9595-4664-9d02-499b49846ff1' `
7+
-AppRoleID '00000000-0000-0000-0000-000000000000' |
8+
Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName,
9+
PrincipalId, PrincipalType, ResourceDisplayName, ResourceId
1310
14-
{{ Add output here }}
11+
Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI
12+
AppRoleId : 00000000-0000-0000-0000-000000000000
13+
PrincipalDisplayName : Adele Vance
14+
PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01
15+
PrincipalType : User
16+
ResourceDisplayName : dxprovisioning-analytics
17+
ResourceId : 0873169c-9595-4664-9d02-499b49846ff1
1518
```
1619

17-
{{ Add description here }}
18-
20+
This commands assigns the specified user a role in the specified application resource.
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Remove a user's application role assignment
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
Remove-MgUserAppRoleAssignment `
5+
-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' `
6+
-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01'
157
```
168

17-
{{ Add description here }}
18-
9+
This example removes the specified application role from the specified user.
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Update an application
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
4+
Update-MgApplication `
5+
-ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' `
6+
-DisplayName 'Testing App'
157
```
168

17-
{{ Add description here }}
18-
9+
This example updates the specified application's display name.
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
### Example 1: {{ Add title here }}
2-
```powershell
3-
PS C:\> {{ Add code here }}
4-
5-
{{ Add output here }}
6-
```
1+
### Example 1: Update the properties of a service principal
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
$ServicePrincipalUpdate =@{
5+
"accountEnabled" = "true"
6+
"appRoleAssignmentRequired" = "true"
7+
}
138
14-
{{ Add output here }}
9+
Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate
1510
```
1611

17-
{{ Add description here }}
18-
12+
This is example, the first command defines the properties and their values in a hashtable under the variable $ServicePrincipalUpdate. The second command updates the specified service principal.

0 commit comments

Comments
 (0)