Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Create a new application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
New-MgApplication -DisplayName 'New app' |
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain

Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309
DisplayName : New app
AppId : c678b75d-1012-4466-8655-1672192232b4
SignInAudience : AzureADandPersonalMicrosoftAccount
PublisherDomain : M365B977454.onmicrosoft.com
```

{{ Add description here }}

This example creates a new application.
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Add an owner to an application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$NewOwner = @{
"@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}"
}

{{ Add output here }}
New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner
```

{{ Add description here }}

In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application.
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Create a new service principal object

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$ServicePrincipalID=@{
"AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62"
}
New-MgServicePrincipal -BodyParameter $ServicePrincipalId |
Format-List id, DisplayName, AppId, SignInAudience

{{ Add output here }}
Id : ac483a5f-f291-4499-8a62-058547724579
DisplayName : Example App
AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec
SignInAudience : AzureADandPersonalMicrosoftAccount
```

{{ Add description here }}

In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object.
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Assign a user an application role

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
-PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
-ResourceId '0873169c-9595-4664-9d02-499b49846ff1' `
-AppRoleID '00000000-0000-0000-0000-000000000000' |
Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName,
PrincipalId, PrincipalType, ResourceDisplayName, ResourceId

{{ Add output here }}
Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI
AppRoleId : 00000000-0000-0000-0000-000000000000
PrincipalDisplayName : Adele Vance
PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01
PrincipalType : User
ResourceDisplayName : dxprovisioning-analytics
ResourceId : 0873169c-9595-4664-9d02-499b49846ff1
```

{{ Add description here }}

This commands assigns the specified user a role in the specified application resource.
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Remove a user's application role assignment

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
Remove-MgUserAppRoleAssignment `
-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' `
-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01'
```

{{ Add description here }}

This example removes the specified application role from the specified user.
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Update an application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
Update-MgApplication `
-ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' `
-DisplayName 'Testing App'
```

{{ Add description here }}

This example updates the specified application's display name.
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Update the properties of a service principal

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$ServicePrincipalUpdate =@{
"accountEnabled" = "true"
"appRoleAssignmentRequired" = "true"
}

{{ Add output here }}
Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate
```

{{ Add description here }}

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.
24 changes: 10 additions & 14 deletions src/Applications/Applications/examples/v1.0/New-MgApplication.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Create a new application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
New-MgApplication -DisplayName 'New app' |
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain

Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309
DisplayName : New app
AppId : c678b75d-1012-4466-8655-1672192232b4
SignInAudience : AzureADandPersonalMicrosoftAccount
PublisherDomain : M365B977454.onmicrosoft.com
```

{{ Add description here }}

This example creates a new application.
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Add an owner to an application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$NewOwner = @{
"@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}"
}

{{ Add output here }}
New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner
```

{{ Add description here }}

In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application.
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Create a new service principal object

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$ServicePrincipalID=@{
"AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62"
}
New-MgServicePrincipal -BodyParameter $ServicePrincipalId |
Format-List id, DisplayName, AppId, SignInAudience

{{ Add output here }}
Id : ac483a5f-f291-4499-8a62-058547724579
DisplayName : Example App
AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec
SignInAudience : AzureADandPersonalMicrosoftAccount
```

{{ Add description here }}

In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object.
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Assign a user an application role

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
-PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' `
-ResourceId '0873169c-9595-4664-9d02-499b49846ff1' `
-AppRoleID '00000000-0000-0000-0000-000000000000' |
Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName,
PrincipalId, PrincipalType, ResourceDisplayName, ResourceId

{{ Add output here }}
Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI
AppRoleId : 00000000-0000-0000-0000-000000000000
PrincipalDisplayName : Adele Vance
PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01
PrincipalType : User
ResourceDisplayName : dxprovisioning-analytics
ResourceId : 0873169c-9595-4664-9d02-499b49846ff1
```

{{ Add description here }}

This commands assigns the specified user a role in the specified application resource.
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Remove a user's application role assignment

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
Remove-MgUserAppRoleAssignment `
-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' `
-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01'
```

{{ Add description here }}

This example removes the specified application role from the specified user.
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Update an application

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
Update-MgApplication `
-ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' `
-DisplayName 'Testing App'
```

{{ Add description here }}

This example updates the specified application's display name.
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```
### Example 1: Update the properties of a service principal

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
$ServicePrincipalUpdate =@{
"accountEnabled" = "true"
"appRoleAssignmentRequired" = "true"
}

{{ Add output here }}
Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate
```

{{ Add description here }}

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.
Loading