From 749cd31e3589d8275839da9b842c9db02071eebb Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Thu, 29 Jul 2021 13:22:28 +0300 Subject: [PATCH 1/5] Added examples to the cmdlets --- .../v1.0-beta/Get-MgGroupAppRoleAssignment.md | 27 ++++++++++--------- .../v1.0-beta/Remove-MgApplication.md | 17 +++--------- .../v1.0/Get-MgGroupAppRoleAssignment.md | 27 ++++++++++--------- .../examples/v1.0/Remove-MgApplication.md | 17 +++--------- .../examples/v1.0-beta/New-MgGroupMember.md | 17 +++--------- .../examples/v1.0-beta/Remove-MgGroup.md | 17 +++--------- .../Groups/examples/v1.0/New-MgGroupMember.md | 17 +++--------- .../Groups/examples/v1.0/Remove-MgGroup.md | 17 +++--------- 8 files changed, 46 insertions(+), 110 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/Get-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/Get-MgGroupAppRoleAssignment.md index 093355d11d5..220d4c3b849 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Get-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/Get-MgGroupAppRoleAssignment.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get appRoleAssignments granted to a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgGroupAppRoleAssignment -GroupId '2692d278-8323-4094-b286-e0ffce5e54a5' | + Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 7/29/2021 10:08:49 AM +DeletedDateTime : +Id : eNKSJiODlECyhuD_zl5UpexaKrcAYuZEhjCKxfNmzDM +PrincipalDisplayName : Marketing +PrincipalId : 2692d278-8323-4094-b286-e0ffce5e54a5 +PrincipalType : Group +ResourceDisplayName : Common Data Service +ResourceId : 93af1c70-e87f-45df-8780-8af2d7afd05e +AdditionalProperties : {} ``` -{{ Add description here }} - +This example get all app role assignments granted to the specified group. diff --git a/src/Applications/Applications/examples/v1.0-beta/Remove-MgApplication.md b/src/Applications/Applications/examples/v1.0-beta/Remove-MgApplication.md index 093355d11d5..31fafd52294 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Remove-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0-beta/Remove-MgApplication.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Delete an application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgApplication -ApplicationId '1bc44759-ef10-46de-b199-40c077768fff' ``` -{{ Add description here }} - +This example deletes the specified application. diff --git a/src/Applications/Applications/examples/v1.0/Get-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Get-MgGroupAppRoleAssignment.md index 093355d11d5..220d4c3b849 100644 --- a/src/Applications/Applications/examples/v1.0/Get-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Get-MgGroupAppRoleAssignment.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get appRoleAssignments granted to a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgGroupAppRoleAssignment -GroupId '2692d278-8323-4094-b286-e0ffce5e54a5' | + Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 7/29/2021 10:08:49 AM +DeletedDateTime : +Id : eNKSJiODlECyhuD_zl5UpexaKrcAYuZEhjCKxfNmzDM +PrincipalDisplayName : Marketing +PrincipalId : 2692d278-8323-4094-b286-e0ffce5e54a5 +PrincipalType : Group +ResourceDisplayName : Common Data Service +ResourceId : 93af1c70-e87f-45df-8780-8af2d7afd05e +AdditionalProperties : {} ``` -{{ Add description here }} - +This example get all app role assignments granted to the specified group. diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgApplication.md b/src/Applications/Applications/examples/v1.0/Remove-MgApplication.md index 093355d11d5..31fafd52294 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgApplication.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Delete an application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgApplication -ApplicationId '1bc44759-ef10-46de-b199-40c077768fff' ``` -{{ Add description here }} - +This example deletes the specified application. diff --git a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupMember.md b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupMember.md index 093355d11d5..8ec8bd2589b 100644 --- a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupMember.md +++ b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupMember.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add a member to a group. -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +New-MgGroupMember -GroupId '872648e7-b23a-4328-bd46-f1bd431c2354' -DirectoryObjectId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This example adds a member specified by the DirectoryObjectId to the specified group. diff --git a/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroup.md b/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroup.md index 093355d11d5..45516b8fdac 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroup.md +++ b/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroup.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgGroup -GroupId 'f6b9791b-dfc1-40d6-9ab6-7b29126c534a' ``` -{{ Add description here }} - +This example deletes the specified group. diff --git a/src/Groups/Groups/examples/v1.0/New-MgGroupMember.md b/src/Groups/Groups/examples/v1.0/New-MgGroupMember.md index 093355d11d5..8ec8bd2589b 100644 --- a/src/Groups/Groups/examples/v1.0/New-MgGroupMember.md +++ b/src/Groups/Groups/examples/v1.0/New-MgGroupMember.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add a member to a group. -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +New-MgGroupMember -GroupId '872648e7-b23a-4328-bd46-f1bd431c2354' -DirectoryObjectId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This example adds a member specified by the DirectoryObjectId to the specified group. diff --git a/src/Groups/Groups/examples/v1.0/Remove-MgGroup.md b/src/Groups/Groups/examples/v1.0/Remove-MgGroup.md index 093355d11d5..45516b8fdac 100644 --- a/src/Groups/Groups/examples/v1.0/Remove-MgGroup.md +++ b/src/Groups/Groups/examples/v1.0/Remove-MgGroup.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgGroup -GroupId 'f6b9791b-dfc1-40d6-9ab6-7b29126c534a' ``` -{{ Add description here }} - +This example deletes the specified group. From 8593a27021ad6d11cebd525ad4a9a34bba575683 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Thu, 19 Aug 2021 14:35:56 +0300 Subject: [PATCH 2/5] Added more examples to cmdlets --- .../v1.0-beta/Get-MgServicePrincipalOwner.md | 19 +++------- .../v1.0-beta/New-MgGroupAppRoleAssignment.md | 38 ++++++++++++++----- .../New-MgServicePrincipalOwnerByRef.md | 19 +++------- .../v1.0/Get-MgServicePrincipalOwner.md | 19 +++------- .../v1.0/New-MgGroupAppRoleAssignment.md | 38 ++++++++++++++----- .../v1.0/New-MgServicePrincipalOwnerByRef.md | 19 +++------- 6 files changed, 80 insertions(+), 72 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalOwner.md b/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalOwner.md index 093355d11d5..229ea2ae67c 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalOwner.md +++ b/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalOwner.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: List the owners of a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgServicePrincipalOwner -ServicePrincipalId '1c48f923-4fbb-4d37-b772-4d577eefec9e' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +8a7c50d3-fcbd-4727-a889-8ab232dfea01 ``` -{{ Add description here }} - +This command lists the owners of the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md index 093355d11d5..3f33fdf92c7 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md @@ -1,18 +1,36 @@ -### Example 1: {{ Add title here }} +### Example 1: Assign an app role to a group + ```powershell -PS C:\> {{ Add code here }} +$appRoleAssignment = @{ + "principalId"= "f07a8d78-f18c-4c02-b339-9ebace025122" + "resourceId"= "1c48f923-4fbb-4d37-b772-4d577eefec9e" + "appRoleId"= "00000000-0000-0000-0000-000000000000" + } + +New-MgGroupAppRoleAssignment -GroupId 'f07a8d78-f18c-4c02-b339-9ebace025122' -BodyParameter $appRoleAssignment | + Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/19/2021 11:25:25 AM +DeletedDateTime : +Id : eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw +PrincipalDisplayName : All Employees +PrincipalId : f07a8d78-f18c-4c02-b339-9ebace025122 +PrincipalType : Group +ResourceDisplayName : Office 365 SharePoint Online +ResourceId : 1c48f923-4fbb-4d37-b772-4d577eefec9e +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#groups('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/$entity], [@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da- + b10d-14f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.Group('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw]} ``` -{{ Add description here }} +In this example, the first command creates the `$appRoleAssignment` variable that defines the following: -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +-`principalId`: The id of the group to which you are assigning the app role. -{{ Add output here }} -``` +-`resourceId`: The id of the resource servicePrincipal which has defined the app role. + +-`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the group. -{{ Add description here }} +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +The second command adds the role to the specified group. diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalOwnerByRef.md b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalOwnerByRef.md index 093355d11d5..af05d88c816 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalOwnerByRef.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$newOwner = @{ + "@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/8a7c50d3-fcbd-4727-a889-8ab232dfea01" + } -{{ Add output here }} +New-MgServicePrincipalOwnerByRef -ServicePrincipalId '1c48f923-4fbb-4d37-b772-4d577eefec9e' -BodyParameter $newOwner ``` -{{ Add description here }} - +In this example, the first command defines the value for the `$newOwner` variable in a hashtable. The second command adds the new owner to the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalOwner.md b/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalOwner.md index 093355d11d5..229ea2ae67c 100644 --- a/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalOwner.md +++ b/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalOwner.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: List the owners of a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgServicePrincipalOwner -ServicePrincipalId '1c48f923-4fbb-4d37-b772-4d577eefec9e' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +8a7c50d3-fcbd-4727-a889-8ab232dfea01 ``` -{{ Add description here }} - +This command lists the owners of the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md index 093355d11d5..3f33fdf92c7 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md @@ -1,18 +1,36 @@ -### Example 1: {{ Add title here }} +### Example 1: Assign an app role to a group + ```powershell -PS C:\> {{ Add code here }} +$appRoleAssignment = @{ + "principalId"= "f07a8d78-f18c-4c02-b339-9ebace025122" + "resourceId"= "1c48f923-4fbb-4d37-b772-4d577eefec9e" + "appRoleId"= "00000000-0000-0000-0000-000000000000" + } + +New-MgGroupAppRoleAssignment -GroupId 'f07a8d78-f18c-4c02-b339-9ebace025122' -BodyParameter $appRoleAssignment | + Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/19/2021 11:25:25 AM +DeletedDateTime : +Id : eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw +PrincipalDisplayName : All Employees +PrincipalId : f07a8d78-f18c-4c02-b339-9ebace025122 +PrincipalType : Group +ResourceDisplayName : Office 365 SharePoint Online +ResourceId : 1c48f923-4fbb-4d37-b772-4d577eefec9e +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#groups('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/$entity], [@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da- + b10d-14f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.Group('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw]} ``` -{{ Add description here }} +In this example, the first command creates the `$appRoleAssignment` variable that defines the following: -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +-`principalId`: The id of the group to which you are assigning the app role. -{{ Add output here }} -``` +-`resourceId`: The id of the resource servicePrincipal which has defined the app role. + +-`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the group. -{{ Add description here }} +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +The second command adds the role to the specified group. diff --git a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalOwnerByRef.md b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalOwnerByRef.md index 093355d11d5..af05d88c816 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalOwnerByRef.md +++ b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$newOwner = @{ + "@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/8a7c50d3-fcbd-4727-a889-8ab232dfea01" + } -{{ Add output here }} +New-MgServicePrincipalOwnerByRef -ServicePrincipalId '1c48f923-4fbb-4d37-b772-4d577eefec9e' -BodyParameter $newOwner ``` -{{ Add description here }} - +In this example, the first command defines the value for the `$newOwner` variable in a hashtable. The second command adds the new owner to the specified service principal. From f95174ed14d75826d75447e3d301d4e37b35bb0e Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Tue, 31 Aug 2021 10:43:39 +0300 Subject: [PATCH 3/5] Added more examples --- .../v1.0-beta/New-MgGroupAppRoleAssignment.md | 4 ++-- .../v1.0/New-MgGroupAppRoleAssignment.md | 6 +++--- .../v1.0-beta/Get-MgDirectoryDeletedItem.md | 19 ++++++------------- .../v1.0/Get-MgDirectoryDeletedItem.md | 19 ++++++------------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md index 3f33fdf92c7..c3e4e6bc03b 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md @@ -31,6 +31,6 @@ In this example, the first command creates the `$appRoleAssignment` variable tha -`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the group. -Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). -The second command adds the role to the specified group. +The second command adds the role to the specified group. diff --git a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md index 3f33fdf92c7..7078a581edf 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md @@ -29,8 +29,8 @@ In this example, the first command creates the `$appRoleAssignment` variable tha -`resourceId`: The id of the resource servicePrincipal which has defined the app role. --`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the group. +-`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the group. -Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). -The second command adds the role to the specified group. +The second command adds the role to the specified group. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryDeletedItem.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryDeletedItem.md index 093355d11d5..a227c30dba9 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryDeletedItem.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryDeletedItem.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Retrieve a list of recently deleted items -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgDirectoryDeletedItem -DirectoryObjectId 'd4142c52-179b-4d31-b5b9-08940873507b' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +d4142c52-179b-4d31-b5b9-08940873507b 8/30/2021 7:37:37 AM ``` -{{ Add description here }} - +This command returns the details of the specified directory object. The DirectoryObjectId can be an application, group or user resource. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryDeletedItem.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryDeletedItem.md index 093355d11d5..a227c30dba9 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryDeletedItem.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryDeletedItem.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Retrieve a list of recently deleted items -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgDirectoryDeletedItem -DirectoryObjectId 'd4142c52-179b-4d31-b5b9-08940873507b' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +d4142c52-179b-4d31-b5b9-08940873507b 8/30/2021 7:37:37 AM ``` -{{ Add description here }} - +This command returns the details of the specified directory object. The DirectoryObjectId can be an application, group or user resource. From 1da1319e5b94354f41c8a06e150903475d2830f3 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Tue, 31 Aug 2021 17:34:56 +0300 Subject: [PATCH 4/5] Added examples to cmdlets --- ...Get-MgServicePrincipalAppRoleAssignment.md | 41 +++++++++++++------ .../v1.0-beta/New-MgGroupAppRoleAssignment.md | 2 +- ...New-MgServicePrincipalAppRoleAssignment.md | 37 +++++++++++++---- ...ove-MgServicePrincipalAppRoleAssignment.md | 17 ++------ ...Get-MgServicePrincipalAppRoleAssignment.md | 41 +++++++++++++------ .../v1.0/New-MgGroupAppRoleAssignment.md | 2 +- ...New-MgServicePrincipalAppRoleAssignment.md | 37 +++++++++++++---- ...ove-MgServicePrincipalAppRoleAssignment.md | 17 ++------ .../v1.0-beta/Get-MgUserCreatedObject.md | 21 ++++------ .../examples/v1.0/Get-MgUserCreatedObject.md | 21 ++++------ 10 files changed, 136 insertions(+), 100 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..fd20f0db6a2 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/Get-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,33 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get all application role assignments for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId '0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61' | Format-List -{{ Add output here }} -``` +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 2:01:28 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 Management APIs +ResourceId : 557aedfc-007c-4904-918a-7e6fed2e7403 +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/directoryObjects/$/Microsof + t.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61')/appRoleAssignments/PRLbC6e4yUyM + wr0XutBvYfZHkKGzlbxDr2I-QJWN9rs]} -{{ Add description here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 1:59:44 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYZsr7FiAW3pIqP4F9944yBc +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 SharePoint Online +ResourceId : 1c48f923-4fbb-4d37-b772-4d577eefec9e +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/directoryObjects/$/Microsof + t.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61')/appRoleAssignments/PRLbC6e4yUyM + wr0XutBvYZsr7FiAW3pIqP4F9944yBc]} +``` +This example gets the application role assignments that have been granted to the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md index c3e4e6bc03b..b8d18074e63 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgGroupAppRoleAssignment.md @@ -23,7 +23,7 @@ AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metad b10d-14f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.Group('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw]} ``` -In this example, the first command creates the `$appRoleAssignment` variable that defines the following: +In this example, the first command defines the `$appRoleAssignment` variable that defines the following: -`principalId`: The id of the group to which you are assigning the app role. diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..39f9ee467b4 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,37 @@ ### Example 1: {{ Add title here }} + ```powershell -PS C:\> {{ Add code here }} +$appRoleAssignment = @{ + "principalId"= "0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61" + "resourceId"= "557aedfc-007c-4904-918a-7e6fed2e7403" + "appRoleId"= "00000000-0000-0000-0000-000000000000" + } + +New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 -BodyParameter $appRoleAssignment | Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 2:01:28 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 Management APIs +ResourceId : 557aedfc-007c-4904-918a-7e6fed2e7403 +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#servicePrincipals('0bdb123d-b8a7-4cc9-8cc2-bd17 + bad06f61')/appRoleAssignments/$entity], [@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-1 + 4f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad + 06f61')/appRoleAssignments/PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs]} ``` -{{ Add description here }} +In this example, the first command defines the `$appRoleAssignment` variable that defines the following: -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +-`principalId`: The id of the client service principal to which you are assigning the app role. -{{ Add output here }} -``` +-`resourceId`: The id of the resource `servicePrincipal` (the API) which has defined the app role (the application permission). + +-`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the client service principal. -{{ Add description here }} +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +The second command adds the role to the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..e14efdb138b 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove the application role assignment for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgServicePrincipalAppRoleAssignment -AppRoleAssignmentId 'PRLbC6e4yUyMwr0XutBvYZsr7FiAW3pIqP4F9944yBc' -ServicePrincipalId '0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61' ``` -{{ Add description here }} - +This example removed the assignment of the specified service principal to the specified application role id. diff --git a/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..fd20f0db6a2 100644 --- a/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Get-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,33 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get all application role assignments for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId '0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61' | Format-List -{{ Add output here }} -``` +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 2:01:28 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 Management APIs +ResourceId : 557aedfc-007c-4904-918a-7e6fed2e7403 +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/directoryObjects/$/Microsof + t.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61')/appRoleAssignments/PRLbC6e4yUyM + wr0XutBvYfZHkKGzlbxDr2I-QJWN9rs]} -{{ Add description here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 1:59:44 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYZsr7FiAW3pIqP4F9944yBc +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 SharePoint Online +ResourceId : 1c48f923-4fbb-4d37-b772-4d577eefec9e +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/directoryObjects/$/Microsof + t.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61')/appRoleAssignments/PRLbC6e4yUyM + wr0XutBvYZsr7FiAW3pIqP4F9944yBc]} +``` +This example gets the application role assignments that have been granted to the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md index 7078a581edf..197000b03f5 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgGroupAppRoleAssignment.md @@ -23,7 +23,7 @@ AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metad b10d-14f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.Group('f07a8d78-f18c-4c02-b339-9ebace025122')/appRoleAssignments/eI168IzxAkyzOZ66zgJRIqVVeeA1CVFKmaBn-MGn0Bw]} ``` -In this example, the first command creates the `$appRoleAssignment` variable that defines the following: +In this example, the first defines creates the `$appRoleAssignment` variable that defines the following: -`principalId`: The id of the group to which you are assigning the app role. diff --git a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..39f9ee467b4 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,37 @@ ### Example 1: {{ Add title here }} + ```powershell -PS C:\> {{ Add code here }} +$appRoleAssignment = @{ + "principalId"= "0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61" + "resourceId"= "557aedfc-007c-4904-918a-7e6fed2e7403" + "appRoleId"= "00000000-0000-0000-0000-000000000000" + } + +New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 -BodyParameter $appRoleAssignment | Format-List -{{ Add output here }} +AppRoleId : 00000000-0000-0000-0000-000000000000 +CreatedDateTime : 8/31/2021 2:01:28 PM +DeletedDateTime : +Id : PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs +PrincipalDisplayName : Example App +PrincipalId : 0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61 +PrincipalType : ServicePrincipal +ResourceDisplayName : Office 365 Management APIs +ResourceId : 557aedfc-007c-4904-918a-7e6fed2e7403 +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#servicePrincipals('0bdb123d-b8a7-4cc9-8cc2-bd17 + bad06f61')/appRoleAssignments/$entity], [@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-1 + 4f1195d665f/directoryObjects/$/Microsoft.DirectoryServices.ServicePrincipal('0bdb123d-b8a7-4cc9-8cc2-bd17bad + 06f61')/appRoleAssignments/PRLbC6e4yUyMwr0XutBvYfZHkKGzlbxDr2I-QJWN9rs]} ``` -{{ Add description here }} +In this example, the first command defines the `$appRoleAssignment` variable that defines the following: -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +-`principalId`: The id of the client service principal to which you are assigning the app role. -{{ Add output here }} -``` +-`resourceId`: The id of the resource `servicePrincipal` (the API) which has defined the app role (the application permission). + +-`appRoleId`: The id of the appRole (defined on the resource service principal) to assign to the client service principal. -{{ Add description here }} +Learn more about the [AppRoleAssignment resource](/graph/api/resources/approleassignment?view=graph-rest-1.0). +The second command adds the role to the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipalAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipalAppRoleAssignment.md index 093355d11d5..e14efdb138b 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipalAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipalAppRoleAssignment.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove the application role assignment for a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgServicePrincipalAppRoleAssignment -AppRoleAssignmentId 'PRLbC6e4yUyMwr0XutBvYZsr7FiAW3pIqP4F9944yBc' -ServicePrincipalId '0bdb123d-b8a7-4cc9-8cc2-bd17bad06f61' ``` -{{ Add description here }} - +This example removed the assignment of the specified service principal to the specified application role id. diff --git a/src/Users/Users/examples/v1.0-beta/Get-MgUserCreatedObject.md b/src/Users/Users/examples/v1.0-beta/Get-MgUserCreatedObject.md index 093355d11d5..20f4931a530 100644 --- a/src/Users/Users/examples/v1.0-beta/Get-MgUserCreatedObject.md +++ b/src/Users/Users/examples/v1.0-beta/Get-MgUserCreatedObject.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a list of directory objects that were created by a user -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgUserCreatedObject -UserId '7162fba5-6647-47a0-9d69-5837795f32e7' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +dd8ab0bb-8da3-4292-8c31-a7d91d04e292 +f61521f6-e79a-4c70-84bc-077a18fc9bc9 +94240411-75f7-44fe-b38a-674bd9f4d7c3 ``` -{{ Add description here }} - +This command gets a list of all directory objects that have been created by the specified user. This works for a user who isn't in any administrator role. diff --git a/src/Users/Users/examples/v1.0/Get-MgUserCreatedObject.md b/src/Users/Users/examples/v1.0/Get-MgUserCreatedObject.md index 093355d11d5..20f4931a530 100644 --- a/src/Users/Users/examples/v1.0/Get-MgUserCreatedObject.md +++ b/src/Users/Users/examples/v1.0/Get-MgUserCreatedObject.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a list of directory objects that were created by a user -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgUserCreatedObject -UserId '7162fba5-6647-47a0-9d69-5837795f32e7' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +dd8ab0bb-8da3-4292-8c31-a7d91d04e292 +f61521f6-e79a-4c70-84bc-077a18fc9bc9 +94240411-75f7-44fe-b38a-674bd9f4d7c3 ``` -{{ Add description here }} - +This command gets a list of all directory objects that have been created by the specified user. This works for a user who isn't in any administrator role. From 082c142f5b49299e347428e4d577c7370e204752 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Mon, 6 Sep 2021 06:48:06 +0300 Subject: [PATCH 5/5] Added more examples --- .../v1.0-beta/Get-MgAdministrativeUnit.md | 12 ++++++--- .../examples/v1.0-beta/Get-MgSubscribedSku.md | 27 ++++++++++--------- .../v1.0-beta/New-MgAdministrativeUnit.md | 18 +++++-------- .../New-MgDirectoryRoleMemberByRef.md | 19 +++++-------- .../v1.0-beta/Remove-MgAdministrativeUnit.md | 17 +++--------- .../v1.0-beta/Update-MgAdministrativeUnit.md | 16 +++-------- .../examples/v1.0/Get-MgSubscribedSku.md | 27 ++++++++++--------- .../v1.0-beta/Set-MgUserManagerByRef.md | 17 +++--------- .../v1.0/Remove-MgUserManagerByRef.md | 17 +++--------- 9 files changed, 61 insertions(+), 109 deletions(-) diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgAdministrativeUnit.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgAdministrativeUnit.md index 093355d11d5..fbca067a9dd 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgAdministrativeUnit.md @@ -1,11 +1,15 @@ -### Example 1: {{ Add title here }} +### Example 1: Get a list of administrative units + ```powershell -PS C:\> {{ Add code here }} +Get-MgDirectoryAdministrativeUnit -{{ Add output here }} +DeletedDateTime Id Description DisplayName Visibility +--------------- -- ----------- ----------- ---------- + 416f19a5-2e01-4d15-a78c-d9028fee1ebb Test Unit + d924fbd3-69c5-4cdf-b9ea-9b0badcf9c4d East wing Unit ``` -{{ Add description here }} +This example retrieves a list of administrative units. ### Example 2: {{ Add title here }} ```powershell diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgSubscribedSku.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgSubscribedSku.md index 093355d11d5..52da0babb06 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgSubscribedSku.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgSubscribedSku.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get subscribed SKUs -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgSubscribedSKU | Format-List -{{ Add output here }} +AppliesTo : User +CapabilityStatus : Enabled +ConsumedUnits : 23 +Id : fb625e04-52aa-42da-b10d-14f1195d665f_cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46 +PrepaidUnits : Microsoft.Graph.PowerShell.Models.MicrosoftGraphLicenseUnitsDetail +ServicePlans : {M365_LIGHTHOUSE_PARTNER_PLAN1, WINDOWSUPDATEFORBUSINESS_DEPLOYMENTSERVICE, UNIVERSAL_PRINT_01, + M365_LIGHTHOUSE_CUSTOMER_PLAN1...} +SkuId : cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46 +SkuPartNumber : SPB +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/subscribedSkus/fb625e04-52a + a-42da-b10d-14f1195d665f_cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46]} ``` -{{ Add description here }} - +This command gets the information about the service SKU that the company has subscribed to. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgAdministrativeUnit.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgAdministrativeUnit.md index 093355d11d5..eda3b22fb18 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgAdministrativeUnit.md @@ -1,18 +1,12 @@ ### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +New-MgDirectoryAdministrativeUnit -DisplayName 'Test Unit' -{{ Add output here }} -``` +DeletedDateTime Id Description DisplayName Visibility +--------------- -- ----------- ----------- ---------- + 416f19a5-2e01-4d15-a78c-d9028fee1ebb Test Unit -{{ Add description here }} +``` +This example creates a new administrative unit. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md index 093355d11d5..b682771d87f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +### Example 1: Add an administrative unit member -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$member = @{ + "@odata.id"="https://graph.microsoft.com/v1.0/users/{8a7c50d3-fcbd-4727-a889-8ab232dfea01}" + } -{{ Add output here }} +New-MgDirectoryAdministrativeUnitMemberByRef -AdministrativeUnitId 'd924fbd3-69c5-4cdf-b9ea-9b0badcf9c4d'-BodyParameter $member ``` -{{ Add description here }} +The first command defines the member to be added to the administrative unit. +The second command adds the member to the specified administrative unit. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgAdministrativeUnit.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgAdministrativeUnit.md index 093355d11d5..1239a872b3b 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgAdministrativeUnit.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove an administrative unit -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgDirectoryAdministrativeUnit -AdministrativeUnitId '416f19a5-2e01-4d15-a78c-d9028fee1ebb' ``` -{{ Add description here }} - +This example removes the specified administrative unit. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgAdministrativeUnit.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgAdministrativeUnit.md index 093355d11d5..e4d12ddf753 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgAdministrativeUnit.md @@ -1,18 +1,8 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update an administrative unit -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Update-MgDirectoryAdministrativeUnit -AdministrativeUnitId 'd924fbd3-69c5-4cdf-b9ea-9b0badcf9c4d' -Description 'East wing unit members' -{{ Add output here }} ``` -{{ Add description here }} - +This example updates the description of the specified administrative unit. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgSubscribedSku.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgSubscribedSku.md index 093355d11d5..52da0babb06 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgSubscribedSku.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgSubscribedSku.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get subscribed SKUs -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgSubscribedSKU | Format-List -{{ Add output here }} +AppliesTo : User +CapabilityStatus : Enabled +ConsumedUnits : 23 +Id : fb625e04-52aa-42da-b10d-14f1195d665f_cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46 +PrepaidUnits : Microsoft.Graph.PowerShell.Models.MicrosoftGraphLicenseUnitsDetail +ServicePlans : {M365_LIGHTHOUSE_PARTNER_PLAN1, WINDOWSUPDATEFORBUSINESS_DEPLOYMENTSERVICE, UNIVERSAL_PRINT_01, + M365_LIGHTHOUSE_CUSTOMER_PLAN1...} +SkuId : cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46 +SkuPartNumber : SPB +AdditionalProperties : {[@odata.id, https://graph.microsoft.com/v2/fb625e04-52aa-42da-b10d-14f1195d665f/subscribedSkus/fb625e04-52a + a-42da-b10d-14f1195d665f_cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46]} ``` -{{ Add description here }} - +This command gets the information about the service SKU that the company has subscribed to. diff --git a/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md b/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md index 093355d11d5..e72f8807e1e 100644 --- a/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md +++ b/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove the manager of a user -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgUserManagerByRef -UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This command removes the manager of the specified user. diff --git a/src/Users/Users/examples/v1.0/Remove-MgUserManagerByRef.md b/src/Users/Users/examples/v1.0/Remove-MgUserManagerByRef.md index 093355d11d5..e72f8807e1e 100644 --- a/src/Users/Users/examples/v1.0/Remove-MgUserManagerByRef.md +++ b/src/Users/Users/examples/v1.0/Remove-MgUserManagerByRef.md @@ -1,18 +1,7 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove the manager of a user -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgUserManagerByRef -UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This command removes the manager of the specified user.