You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: microsoftgraph/docs-conceptual/get-started.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,17 @@ description: "Get started with the Microsoft Graph PowerShell SDK by using it pe
5
5
author: jasonjoh
6
6
manager: CelesteDG
7
7
ms.topic: quickstart
8
-
ms.date: 04/07/2022
8
+
ms.date: 04/25/2023
9
9
ms.author: jasonjoh
10
10
---
11
11
12
12
# Get started with the Microsoft Graph PowerShell SDK
13
13
14
-
In this guide, you'll use the Microsoft Graph PowerShell SDK to perform some basic tasks. If you haven't already[installed the SDK](installation.md), do so before following this guide.
14
+
In this guide, you'll use the Microsoft Graph PowerShell SDK to perform some basic tasks. If you haven't already, [install the SDK](installation.md) before following this guide.
15
15
16
16
## API version
17
17
18
-
By default, the SDK uses the [Microsoft Graph REST API v1.0](/graph/api/overview?view=graph-rest-1.0&preserve-view=true). You can change the profile by using the `Select-MgProfile` command.
18
+
By default, the SDK uses the [Microsoft Graph REST API v1.0](/graph/api/overview?view=graph-rest-1.0&preserve-view=true). Cmdlets are available for the API version that is selected. You can change the profile by using the `Select-MgProfile` command.
19
19
20
20
```powershell
21
21
Select-MgProfile -Name "beta"
@@ -31,14 +31,14 @@ For details on using app-only access for unattended scenarios, see [Use app-only
31
31
32
32
Each API in the Microsoft Graph is protected by one or more permission scopes. The user logging in must consent to one of the required scopes for the APIs you plan to use. In this example, we'll use the following APIs.
33
33
34
-
-[List users](/graph/api/user-list?view=graph-rest-1.0&preserve-view=true) to find the user ID of the logged-in user
34
+
-[List users](/graph/api/user-list?view=graph-rest-1.0&preserve-view=true) to find the user ID of the logged-in user.
35
35
-[List joinedTeams](/graph/api/user-list-joinedteams?view=graph-rest-1.0&preserve-view=true) to get the Teams the user is a member of.
36
36
-[List channels](/graph/api/channel-list?view=graph-rest-1.0&preserve-view=true) to get the channels in a Team.
37
-
-[Send message](/graph/api/channel-post-messages?view=graph-rest-1.0&preserve-view=true) to send a message to a Team channel.
37
+
-[Send message](/graph/api/channel-post-messages?view=graph-rest-1.0&preserve-view=true) to send a message to a Team's channel.
38
38
39
39
The `User.Read.All` permission scope will enable the first two calls, and the `Group.ReadWrite.All` scope will enable the rest. These permissions require an admin account.
40
40
41
-
### Using Find-MgGraphCommand to find required permissions
41
+
####Using Find-MgGraphCommand to find required permissions
42
42
43
43
The `Find-MgGraphCommand` cmdlet can be used to discover the required permissions for another cmdlet. For example, to see all permissions that can be used to call `Get-MgUser`, run;
44
44
@@ -81,7 +81,7 @@ Now that you're signed in, you can start making calls to Microsoft Graph.
81
81
82
82
### Get the signed-in user
83
83
84
-
In this section, you'll locate the signed-in user and get their user ID. You'll need that to use as a parameter to the other commands you'll use later. Start by running the following command.
84
+
In this section, you'll locate the signed-in user and get their user Id. You'll need the user Id as a parameter to the other commands you'll run later. Start by running the following command.
85
85
86
86
```powershell
87
87
Get-MgUser
@@ -103,7 +103,7 @@ ce73bdb5-bf12-405e-ab85-40122fdd6eb7 Brian Johnson (TAILSPIN) [email protected]
103
103
df1347a3-7ce7-4b4d-8aab-7c65b5c907b9 Cameron White CameronW@contoso…
104
104
```
105
105
106
-
You can use an [OData filter](/graph/query-parameters#filter-parameter) to help locate the specific user you want. Run the following command, replacing `Megan Bowen` with the display name of the user you signed in with.
106
+
You can use an [OData filter](use-query-parameters.md#filter-parameter) to help locate the specific user you want. Run the following command, replacing `Megan Bowen` with the display name of the user you signed in with.
Now use the user's ID as a parameter to the `Get-MgUserJoinedTeam` command.
120
+
Now use the user's Id as a parameter to the `Get-MgUserJoinedTeam` command.
121
121
122
122
```powershell
123
123
Get-MgUserJoinedTeam -UserId $user.Id
@@ -127,7 +127,7 @@ Just like the `Get-MgUser` command, this command gives a list of teams. Select o
127
127
128
128
### List team channels
129
129
130
-
Now use the team's ID as a parameter to the `Get-MgTeamChannel` command, following a similar pattern of listing all channels, then filtering the list to get the specific channel you want.
130
+
Now use the team's Id as a parameter to the `Get-MgTeamChannel` command, following a similar pattern of listing all channels, then filtering the list to get the specific channel you want.
This command differs from the previous commands you used. Instead of querying data, it's actually creating something. In Microsoft Graph, this command translates to an HTTP `POST`, and it requires an object in the body of that post. In this case, the object is a [chatMessage](/graph/api/resources/chatmessage). The `-Body` parameter to the command maps to the `body` property on `chatMessage`. Other properties are mapped in a similar way, so you can change the message you send. For example, to send an urgent message use the following command.
145
+
This command differs from the previous commands you used. Instead of querying data, it's creating something. In Microsoft Graph, this command translates to an HTTP `POST`, and it requires an object in the body of that post. In this case, the object is a [chatMessage](/graph/api/resources/chatmessage). The `-Body` parameter to the command maps to the `body` property on `chatMessage`. Other properties are mapped in a similar way, so you can change the message you send. For example, to send an urgent message use the following command.
0 commit comments