Skip to content

Commit ace4cb4

Browse files
msewawerugeorgend
andauthored
Added examples for the cmdlets (#685)
* Added examples for the cmdlets * Added an example the new-mguser cmdlet * Updated the examples to conform to the AutoREST format Co-authored-by: George <[email protected]>
1 parent 6c9d8da commit ace4cb4

File tree

16 files changed

+246
-174
lines changed

16 files changed

+246
-174
lines changed
Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get a list of applications
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgApplication |
5+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
46
5-
{{ Add output here }}
7+
Id : 8ea936e0-cb74-46c0-8408-d4614a596267
8+
DisplayName : Test App
9+
AppId : 39b09640-ec3e-44c9-b3de-f52db4e1cf66
10+
SignInAudience : AzureADandPersonalMicrosoftAccount
11+
PublisherDomain : contoso.com
612
```
713

8-
{{ Add description here }}
14+
This examples gets a list of all the applications.
15+
16+
### Example 2: Get an application by Id
917

10-
### Example 2: {{ Add title here }}
1118
```powershell
12-
PS C:\> {{ Add code here }}
19+
Get-MgApplication -Filter "AppId eq '39b09640-ec3e-44c9-b3de-f52db4e1cf66'" |
20+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
1321
14-
{{ Add output here }}
22+
DisplayName : Test App
23+
AppId : 39b09640-ec3e-44c9-b3de-f52db4e1cf66
24+
SignInAudience : AzureADandPersonalMicrosoftAccount
25+
PublisherDomain : contoso.com
1526
```
1627

17-
{{ Add description here }}
18-
28+
This examples gets the application by the specified Id.
Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get all service principals from the directory
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgServicePrincipal
5+
6+
Id : 304ae362-7953-4d08-8e15-aeece4d01017c
7+
DisplayName : IC3 Gateway TestClone
8+
AppId : 509ab5b8-1380-4906-9765-76d2ace9335d
9+
SignInAudience : AzureADMultipleOrgs
410
5-
{{ Add output here }}
11+
Id : 4297089a-3358-4bf5-92b0-a35fbdb2407c
12+
DisplayName : Microsoft Forms
13+
AppId : 67c93110-694e-4a54-b1af-d6cd2e3b12d7
14+
SignInAudience : AzureADMultipleOrgs
615
```
716

8-
{{ Add description here }}
17+
This example retrieves all service principals from the directory.
18+
19+
### Example 2: Get the service principal by display name
920

10-
### Example 2: {{ Add title here }}
1121
```powershell
12-
PS C:\> {{ Add code here }}
22+
Get-MgServicePrincipal -Filter "DisplayName eq 'Power BI Service'" |
23+
Format-List Id, DisplayName,AppId, SignInAudience
1324
14-
{{ Add output here }}
25+
Id : 9518fb8f-8d9e-4aae-be20-d398f9cc59ac
26+
DisplayName : Power BI Service
27+
AppId : 60dbf324-9702-41cc-a5fa-f8d19804b014
28+
SignInAudience : AzureADMultipleOrgs
1529
```
1630

17-
{{ Add description here }}
18-
31+
This example gets the service principal by display name.
Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get a list of applications
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgApplication |
5+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
46
5-
{{ Add output here }}
7+
Id : 8ea936e0-cb74-46c0-8408-d4614a596267
8+
DisplayName : Test App
9+
AppId : 39b09640-ec3e-44c9-b3de-f52db4e1cf66
10+
SignInAudience : AzureADandPersonalMicrosoftAccount
11+
PublisherDomain : contoso.com
612
```
713

8-
{{ Add description here }}
14+
This examples gets a list of all the applications.
15+
16+
### Example 2: Get an application by Id
917

10-
### Example 2: {{ Add title here }}
1118
```powershell
12-
PS C:\> {{ Add code here }}
19+
Get-MgApplication -Filter "AppId eq '39b09640-ec3e-44c9-b3de-f52db4e1cf66'" |
20+
Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain
1321
14-
{{ Add output here }}
22+
DisplayName : Test App
23+
AppId : 39b09640-ec3e-44c9-b3de-f52db4e1cf66
24+
SignInAudience : AzureADandPersonalMicrosoftAccount
25+
PublisherDomain : contoso.com
1526
```
1627

17-
{{ Add description here }}
18-
28+
This examples gets the application by the specified Id.
Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get all service principals from the directory
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgServicePrincipal
5+
6+
Id : 304ae362-7953-4d08-8e15-aeece4d01017c
7+
DisplayName : IC3 Gateway TestClone
8+
AppId : 509ab5b8-1380-4906-9765-76d2ace9335d
9+
SignInAudience : AzureADMultipleOrgs
410
5-
{{ Add output here }}
11+
Id : 4297089a-3358-4bf5-92b0-a35fbdb2407c
12+
DisplayName : Microsoft Forms
13+
AppId : 67c93110-694e-4a54-b1af-d6cd2e3b12d7
14+
SignInAudience : AzureADMultipleOrgs
615
```
716

8-
{{ Add description here }}
17+
This example retrieves all service principals from the directory.
18+
19+
### Example 2: Get the service principal by display name
920

10-
### Example 2: {{ Add title here }}
1121
```powershell
12-
PS C:\> {{ Add code here }}
22+
Get-MgServicePrincipal -Filter "DisplayName eq 'Power BI Service'" |
23+
Format-List Id, DisplayName,AppId, SignInAudience
1324
14-
{{ Add output here }}
25+
Id : 9518fb8f-8d9e-4aae-be20-d398f9cc59ac
26+
DisplayName : Power BI Service
27+
AppId : 60dbf324-9702-41cc-a5fa-f8d19804b014
28+
SignInAudience : AzureADMultipleOrgs
1529
```
1630

17-
{{ Add description here }}
18-
31+
This example gets the service principal by display name.
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get a list of groups
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgGroup |
5+
Format-List Id, DisplayName, Description, GroupTypes
6+
7+
Id : 0a1c8435-40a3-4a72-8586-e916c12b613a
8+
DisplayName : Marketing
9+
Description : A group to synthesize, analyze, and synchronize our marketing efforts.
10+
GroupTypes : {Unified}
411
5-
{{ Add output here }}
12+
Id : a8fbb1b5-b994-4835-9183-c7421d149132
13+
DisplayName : Business Development
14+
Description : Welcome to the BizDev team.
15+
GroupTypes : {Unified}
616
```
717

8-
{{ Add description here }}
18+
This examples retrieves a list of groups.
19+
20+
### Example 2: Get a group by the display name
921

10-
### Example 2: {{ Add title here }}
1122
```powershell
12-
PS C:\> {{ Add code here }}
23+
Get-MgGroup -Filter "DisplayName eq 'Business Development'" |
24+
Format-List Id, DisplayName, Description, GroupTypes
1325
14-
{{ Add output here }}
26+
Id : a8fbb1b5-b994-4835-9183-c7421d149132
27+
DisplayName : Business Development
28+
Description : Welcome to the BizDev team.
29+
GroupTypes : {Unified}
1530
```
1631

17-
{{ Add description here }}
18-
32+
This example gets a group by the specified display name.
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: Get members of a group
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+
Get-MgGroupMember -GroupId '7b7be3ab-d2b3-441c-8111-2e89b8493fff'
5+
6+
Id DeletedDateTime
7+
-- ---------------
8+
6733b39d-1b5d-46af-adf3-4589718be012
9+
0107d1b2-0402-4ef9-a58c-eb0661c5d596
10+
f9f1bd4f-16ca-4404-925e-5b08b6a3832f
11+
5441e919-583c-4292-aa3f-98250d8d217b
1512
```
1613

17-
{{ Add description here }}
18-
14+
This examples gets the members of the specified group.
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: Create a new group
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
New-MgGroup -DisplayName 'Test Group' -MailEnabled:$False -MailNickName 'testgroup' -SecurityEnabled
135
14-
{{ Add output here }}
6+
Id DisplayName Description GroupTypes
7+
-- ----------- ----------- ----------
8+
15bb6c2c-ac32-41a1-b9ec-b6300b8b8e52 Test Group {}
159
```
1610

17-
{{ Add description here }}
18-
11+
This example creates a new group.
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get a list of groups
2+
23
```powershell
3-
PS C:\> {{ Add code here }}
4+
Get-MgGroup |
5+
Format-List Id, DisplayName, Description, GroupTypes
6+
7+
Id : 0a1c8435-40a3-4a72-8586-e916c12b613a
8+
DisplayName : Marketing
9+
Description : A group to synthesize, analyze, and synchronize our marketing efforts.
10+
GroupTypes : {Unified}
411
5-
{{ Add output here }}
12+
Id : a8fbb1b5-b994-4835-9183-c7421d149132
13+
DisplayName : Business Development
14+
Description : Welcome to the BizDev team.
15+
GroupTypes : {Unified}
616
```
717

8-
{{ Add description here }}
18+
This examples retrieves a list of groups.
19+
20+
### Example 2: Get a group by the display name
921

10-
### Example 2: {{ Add title here }}
1122
```powershell
12-
PS C:\> {{ Add code here }}
23+
Get-MgGroup -Filter "DisplayName eq 'Business Development'" |
24+
Format-List Id, DisplayName, Description, GroupTypes
1325
14-
{{ Add output here }}
26+
Id : a8fbb1b5-b994-4835-9183-c7421d149132
27+
DisplayName : Business Development
28+
Description : Welcome to the BizDev team.
29+
GroupTypes : {Unified}
1530
```
1631

17-
{{ Add description here }}
18-
32+
This example gets a group by the specified display name.
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: Get members of a group
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+
Get-MgGroupMember -GroupId '7b7be3ab-d2b3-441c-8111-2e89b8493fff'
5+
6+
Id DeletedDateTime
7+
-- ---------------
8+
6733b39d-1b5d-46af-adf3-4589718be012
9+
0107d1b2-0402-4ef9-a58c-eb0661c5d596
10+
f9f1bd4f-16ca-4404-925e-5b08b6a3832f
11+
5441e919-583c-4292-aa3f-98250d8d217b
1512
```
1613

17-
{{ Add description here }}
18-
14+
This examples gets the members of the specified group.
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: Create a new group
72

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
113
```powershell
12-
PS C:\> {{ Add code here }}
4+
New-MgGroup -DisplayName 'Test Group' -MailEnabled:$False -MailNickName 'testgroup' -SecurityEnabled
135
14-
{{ Add output here }}
6+
Id DisplayName Description GroupTypes
7+
-- ----------- ----------- ----------
8+
15bb6c2c-ac32-41a1-b9ec-b6300b8b8e52 Test Group {}
159
```
1610

17-
{{ Add description here }}
18-
11+
This example creates a new group.

0 commit comments

Comments
 (0)