Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 04f4944

Browse files
authored
Update samples (#282)
1 parent 25115cd commit 04f4944

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

samples/3-UsersAndGroups.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ Powershell:
3232

3333
```powershell
3434
$body = ConvertTo-Json '{"officeLocation": "NewLocation"}'
35-
mgc users item patch --user-id <UserId> --body $body
35+
mgc users patch --user-id <UserId> --body $body
3636
```
3737

3838
CMD:
3939

4040
```sh
41-
mgc users item patch --user-id <UserId> --body "{""officeLocation"": ""NewLocation""}"
41+
mgc users patch --user-id <UserId> --body "{""officeLocation"": ""NewLocation""}"
4242
```
4343

4444
Bash:
4545

4646
```sh
47-
mgc users item patch --user-id <UserId> --body '{"officeLocation": "NewLocation"}'
47+
mgc users patch --user-id <UserId> --body '{"officeLocation": "NewLocation"}'
4848
```
4949

5050
### Get all Groups
@@ -62,13 +62,13 @@ mgc groups list --filter "groupTypes/any(c:c eq 'Unified')"
6262
### Get-Details of a single Group
6363

6464
```sh
65-
mgc groups item get --group-id <GroupId>
65+
mgc groups get --group-id <GroupId>
6666
```
6767

6868
### Get Owners of a Group
6969

7070
```sh
71-
mgc groups item owners list --group-id <GroupId>
71+
mgc groups owners list --group-id <GroupId>
7272
```
7373

7474
### Get Members of a Group
@@ -80,7 +80,7 @@ mgc groups members list --group-id <GroupId>
8080
### Get your mail
8181

8282
```sh
83-
mgc users item messages list --user-id <UserId> --filter "contains(subject,'Marketing')" --select "sentDateTime, subject"
83+
mgc users messages list --user-id <UserId> --filter "contains(subject,'Marketing')" --select "sentDateTime, subject"
8484
```
8585

8686
### New Group
@@ -107,7 +107,7 @@ mgc groups create --body '{"displayName": "PowerFam", "mailEnabled": false, "mai
107107
### Remove Group
108108

109109
```sh
110-
mgc groups item delete --group-id <GroupId>
110+
mgc groups delete --group-id <GroupId>
111111
```
112112

113113
### Create a new User

samples/4-Teams.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PowerShell:
5151

5252
```powershell
5353
$teamOwner=mgc users get --user-id "{TEAM_OWNER_UPN}"
54-
mgc teams item members create --team-id $InternsTeam.id --body '{"additionalProperties": {
54+
mgc teams members create --team-id $InternsTeam.id --body '{"additionalProperties": {
5555
"@odata.type": "#microsoft.graph.aadUserConversationMember",
5656
"[email protected]": "https://graph.microsoft.com/v1.0/users/" + $teamOwner.id
5757
}, "roles": ["owner"]}'
@@ -60,7 +60,7 @@ mgc teams item members create --team-id $InternsTeam.id --body '{"additionalProp
6060
CMD:
6161

6262
```shell
63-
mgc teams item members create --team-id %InternsTeamId% --body "{""additionalProperties"": {""@odata.type"": ""#microsoft.graph.aadUserConversationMember"",""[email protected]"": ""https://graph.microsoft.com/v1.0/users/%UserId%""}, ""roles"": [""owner""]}"
63+
mgc teams members create --team-id %InternsTeamId% --body "{""additionalProperties"": {""@odata.type"": ""#microsoft.graph.aadUserConversationMember"",""[email protected]"": ""https://graph.microsoft.com/v1.0/users/%UserId%""}, ""roles"": [""owner""]}"
6464
```
6565

6666
Bash:
@@ -69,7 +69,7 @@ Bash:
6969
teamOwnerId=$(mgc users get --user-id "{TEAM_OWNER_UPN}" | grep -o '"id": "[^"]*' | grep -o '[^"]*$')
7070
teamId=$(echo $InternsTeam | grep -o '"id": "[^"]*' | grep -o '[^"]*$')
7171

72-
mgc teams item members create --team-id $teamId --body '{"additionalProperties": {
72+
mgc teams members create --team-id $teamId --body '{"additionalProperties": {
7373
"@odata.type": "#microsoft.graph.aadUserConversationMember",
7474
"[email protected]": "https://graph.microsoft.com/v1.0/users/" + $teamOwnerId
7575
}, "roles": ["owner"]}'
@@ -80,23 +80,23 @@ mgc teams item members create --team-id $teamId --body '{"additionalProperties":
8080
PowerShell:
8181

8282
```powershell
83-
$PrimaryChannel = mgc teams item primary-channel get --team-id $InternsTeam.id
83+
$PrimaryChannel = mgc teams primary-channel get --team-id $InternsTeam.id
8484
$body = ConvertTo-Json '{"body": {"content": "Welcome to Teams!"}}'
85-
mgc teams item channels item messages create --team-id $InternsTeam.id --channel-id $PrimaryChannel.id --body $body
85+
mgc teams channels messages create --team-id $InternsTeam.id --channel-id $PrimaryChannel.id --body $body
8686
```
8787

8888
CMD:
8989

9090
```shell
91-
mgc teams item primary-channel get --team-id %TeamId%
92-
mgc teams item channels item messages create --team-id %TeamId% --channel-id %PrimaryChannelId% --body "{""body"": {""content"": ""Welcome to Teams!""}}"
91+
mgc teams primary-channel get --team-id %TeamId%
92+
mgc teams channels messages create --team-id %TeamId% --channel-id %PrimaryChannelId% --body "{""body"": {""content"": ""Welcome to Teams!""}}"
9393
```
9494

9595
Bash:
9696

9797
```sh
98-
PrimaryChannelId=$(mgc teams item primary-channel get --team-id $teamId | grep -o '"id": "[^"]*' | grep -o '[^"]*$')
99-
mgc teams item channels item messages create --team-id $teamId --channel-id $PrimaryChannelId --body '{"body": {"content": "Welcome to Teams!"}}'
98+
PrimaryChannelId=$(mgc teams primary-channel get --team-id $teamId | grep -o '"id": "[^"]*' | grep -o '[^"]*$')
99+
mgc teams channels messages create --team-id $teamId --channel-id $PrimaryChannelId --body '{"body": {"content": "Welcome to Teams!"}}'
100100
```
101101

102102
### Delete team
@@ -130,33 +130,33 @@ mgc chats list
130130
#### Get Messages from Chat
131131

132132
```sh
133-
mgc chats item messages list --chat-id <ChatId>
133+
mgc chats messages list --chat-id <ChatId>
134134
```
135135

136136
#### Send a message in that 1:1 chat
137137

138138
```sh
139-
mgc chats item messages create --chat-id <ChatId> --body '{"body": {"content": "Hi from CLI!"}}'
139+
mgc chats messages create --chat-id <ChatId> --body '{"body": {"content": "Hi from CLI!"}}'
140140
```
141141

142142
#### Mention a user in a channel message
143143

144144
PowerShell:
145145

146146
```powershell
147-
$user = mgc users item get --user-id <UserId> --select "id, displayName, userIdentityType"
147+
$user = mgc users get --user-id <UserId> --select "id, displayName, userIdentityType"
148148
$body = ConvertTo-Json '{"body": {"contentType": "html", "content": "Welcome to the channel <at id=\'0\'>${user.displayName}</at>!"}, "mentions": [{"id": 0, "mentionText": "${user.displayName}", "mentioned": {"user": {"id": "${user.id}", "displayName": "${user.displayName}", "userIdentityType": "${user.userIdentityType}"}}}]}'
149-
mgc teams item channels item messages create --team-id <TeamId> --channel-id $PrimaryChannel.id \
149+
mgc teams channels messages create --team-id <TeamId> --channel-id $PrimaryChannel.id \
150150
--body $body
151151
```
152152

153153
Bash:
154154

155155
```sh
156-
user=$(mgc users item get --user-id <UserId> --select "id, displayName, userIdentityType")
156+
user=$(mgc users get --user-id <UserId> --select "id, displayName, userIdentityType")
157157
userId=$(echo $user | grep -o '"id": "[^"]*' | grep -o '[^"]*$')
158158
userDisplayName=$(echo $user | grep -o '"displayName": "[^"]*' | grep -o '[^"]*$')
159159
userIdentityType=$(echo $user | grep -o '"userIdentityType": "[^"]*' | grep -o '[^"]*$')
160-
mgc teams item channels item messages create --team-id <TeamId> --channel-id $PrimaryChannelId \
160+
mgc teams channels messages create --team-id <TeamId> --channel-id $PrimaryChannelId \
161161
--body '{"body": {"contentType": "html", "content": "Welcome to the channel <at id=\'0\'>${userDisplayName}</at>!"}, "mentions": [{"id": 0, "mentionText": "${userDisplayName}", "mentioned": {"user": {"id": "${userId}", "displayName": "${userDisplayName}", "userIdentityType": "${userIdentityType}"}}}]}'
162162
```

samples/5-Sites.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Get root site
44

55
```sh
6-
mgc sites item get --site-id root --select "id, displayName"
6+
mgc sites get --site-id root --select "id, displayName"
77
```
88

99
### Search for sites
@@ -21,17 +21,17 @@ mgc sites list --search "marketing" --select id
2121
### Get Site Pages
2222

2323
```sh
24-
mgc sites item sites list --site-id <SiteId>
24+
mgc sites sites list --site-id <SiteId>
2525
```
2626

2727
### Get Site Lists
2828

2929
```sh
30-
mgc sites item sites list --site-id <SiteId> --select "id, displayName"
30+
mgc sites sites list --site-id <SiteId> --select "id, displayName"
3131
```
3232

3333
### Get Document Libraries
3434

3535
```sh
36-
mgc sites item drive get --site-id <SiteId>
36+
mgc sites drive get --site-id <SiteId>
3737
```

samples/6-Drives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ mgc drives list
99
### Get drive list
1010

1111
```sh
12-
mgc drives item list get --drive-id <DriveId>
12+
mgc drives list get --drive-id <DriveId>
1313
```

0 commit comments

Comments
 (0)