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
The Microsoft Graph PowerShell module consists of a collection of PowerShell modules that contain commands for calling Microsoft Graph API. The module acts as an API wrapper for the Microsoft Graph APIs, exposing the entire API set for use in PowerShell.
13
+
The Microsoft Graph PowerShell SDK is made up of a set of modules that enable you to interact with the Microsoft Graph API using PowerShell commands. The modules consist of commands that act as wrappers for the API, allowing you to access all the features and functionality of the API through PowerShell.
14
14
</p>
15
15
16
16
<palign="center">
@@ -44,7 +44,7 @@ Microsoft Graph PowerShell module is published on [PowerShell Gallery](https://w
44
44
Install-Module Microsoft.Graph
45
45
```
46
46
47
-
> Run `Install-Module` with AllowClobber and Force parameters if you run into command name conflicts when upgrading to older versions of the module:
47
+
> Run `Install-Module` with `-AllowClobber` and `-Force` parameters if you run into command name conflicts when upgrading to older versions of the module. This may be the case when upgrading from v1.x to v2.x:
@@ -122,10 +122,12 @@ The following breaking changes have been introduced between `v1.x` and `v2.x`:
122
122
- Dropped profile support.
123
123
- Dropped support for `-ForceRefresh` on `Connect-MgGraph`.
124
124
- Renamed `beta` command names from `<Verb>-Mg<Noun>` to `<Verb>-MgBeta<Noun>`.
125
+
- Renamed `DeviceManagement.Enrolment` module to `DeviceManagement.Enrollment`.
126
+
- Moved directory role and entitlement management commands from `DeviceManagement.Enrollment` to `Identity.Governance` module.
125
127
- Changed beta namespace from `Microsoft.Graph.PowerShell.Models.<Entity>` to `Microsoft.Graph.Beta.PowerShell.Models.<Entity>`.
126
128
- Changed `-AccessToken` type on `Connect-MgGraph` from `String` to `SecureString`.
127
129
128
-
See [v2 upgrade guide](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/features/2.0/docs/upgrade-to-v2.md) for more details.
130
+
See the [v2 upgrade guide](./docs/upgrade-to-v2.md) for more details.
129
131
130
132
## Troubleshooting
131
133
@@ -135,13 +137,15 @@ When working with various operations in the Graph, you may encounter an error su
135
137
136
138
If permission-related errors occur and the signed-in user/app has been granted the appropriate permissions to perform the operation, you can explicitly fetch a new access token by running `Disconnect-MgGraph`, then `Connect-MgGraph`. This will trigger a refresh of the access token in your cache. Microsoft Authentication Library (MSAL) will only refresh access tokens in your cache if they have expired (usually an hour).
137
139
140
+
See [Microsoft Graph API Permissions Reference](https://learn.microsoft.com/graph/permissions-reference) for more details.
141
+
138
142
### Common Errors
139
143
140
144
See our [troubleshooting guide](https://learn.microsoft.com/powershell/microsoftgraph/troubleshooting) for a detailed view of how to troubleshoot common errors when using Microsoft Graph.
141
145
142
146
## Known Issues
143
147
144
-
- Using `-Property {PropertyName}` parameter will not select the property as the output of the command. All commands return CLR objects, and customers should pipe the command outputs to `Format-Table` or `Select-Object` to return individual properties.
148
+
- Using the `-Property {PropertyName}` parameter will not select the property as the output of the command. All commands return CLR objects, and customers should pipe the command outputs to `Format-Table` or `Select-Object` to return individual properties.
145
149
146
150
- Customers upgrading from previous versions of the SDK may encounter auth prompts on every command call. If this happens, one can use the following steps to reset their token cache:
147
151
- Use `Disconnect-MgGraph` to sign out of the current session.
Copy file name to clipboardExpand all lines: docs/authentication.md
+18-14
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,6 @@ The Microsoft Graph PowerShell module supports two types of authentication:
5
5
- Delegated Access
6
6
- App-only Access
7
7
8
-
## Web Account Manager (WAM)
9
-
WAM is a Windows 10+ component that acts as an authentication broker allowing the users of an app benefit from integration with accounts known to Windows, such as the account already signed into an active Windows session.
10
-
11
-
Microsoft Graph PowerShell module supports WAM in the following scenraio:
12
-
13
-
- To enable WAM on supported devices
14
-
```PowerShell
15
-
Set-MgGraphOption -EnableLoginByWAM $true
16
-
```
17
-
18
-
- To disable WAM on supported devices
19
-
```PowerShell
20
-
Set-MgGraphOption -EnableLoginByWAM $false
21
-
```
22
8
## Delegated Access
23
9
24
10
Delegated access uses a public client to get an access token and consume Microsoft Graph resources on behalf of the signed-in user.
@@ -125,3 +111,21 @@ When using `-AccessToken`, we won't have access to the refresh token and the cli
125
111
### Access Token Scopes (scp) Claims
126
112
127
113
Before using the provided `-AccessToken` to get Microsoft Graph resources, customers should ensure that the access token has the necessary scopes/ permissions needed to access/modify a resource.
114
+
115
+
## Web Account Manager (WAM)
116
+
117
+
WAM is a Windows 10+ component that acts as an authentication broker allowing the users of an app benefit from integration with accounts known to Windows, such as the account already signed into an active Windows session.
118
+
119
+
Microsoft Graph PowerShell module supports WAM in the following scenario:
Copy file name to clipboardExpand all lines: docs/upgrade-to-v2.md
+37-1
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,14 @@ In v2, we've changed `-AccessToken` from `String` to `SecureString` type. This c
64
64
65
65
We've dropped support for `-ForceRefresh` on `Connect-MgGraph` command. `-ForceRefresh` is no longer support by the auth token credentials used in v2. Customers should instead use `Disconnect-MgGraph` to sign out of current context then call `Connect-MgGraph` to get a new access token.
66
66
67
+
### Renamed `DeviceManagement.Enrolment` module to `DeviceManagement.Enrollment`
68
+
69
+
`DeviceManagement.Enrolment` module has been renamed to `DeviceManagement.Enrollment` to align with the API.
70
+
71
+
### Directory Role and Entitlement Management Commands
72
+
73
+
Directory role and entitlement management commands that were in `DeviceManagement.Enrollment` module have been moved to `Identity.Governance` to align with the [API reference](https://learn.microsoft.com/graph/api/resources/directoryrole?view=graph-rest-1.0).
74
+
67
75
## New Features and Improvements
68
76
69
77
The following new features and improvements have been added to the module in v2.
We've added dedicated count commands in v2 for supported resources. In v2, you can now get a [count of users in your tenant](https://learn.microsoft.com/graph/api/user-list?view=graph-rest-1.0&tabs=http#example-3-get-only-a-count-of-users) using:
See [advanced query capabilities on Azure AD objects](https://learn.microsoft.com/graph/aad-advanced-queries) for more details.
144
+
145
+
#### OData Cast Support
146
+
147
+
V2 adds OData cast commands via `*-Mg*As<CAST-Type>` syntax when supported by the API. With OData cast support, customers can now access properties on specialized types rather than going through AdditionalProperties for supported APIs. For example, one can use `Get-MgGroupMemberAsUser` to [list group members that are users](https://learn.microsoft.com/graph/api/group-list-members?view=graph-rest-1.0&tabs=http):
> In the example above, the cast type can also be `ServicePrincipal`, `Application`, `Device`, `Group`, and more as supported by the API.
154
+
155
+
#### Improved Service Error Reporting
156
+
157
+
We've updated how service errors are written to the error stream to help with debugging API related errors. In v2, when a service error occurs, the SDK will now write message, HTTP status code, error code, request-id, date, and other useful headers to the error stream.
See [Microsoft Graph API error response](https://learn.microsoft.com/graph/errors) for more details.
162
+
127
163
#### HTTP/2 support
128
164
129
-
v2 adds [HTTP/2](https://httpwg.org/specs/rfc7540.html) support for supported API endpoints. The module will gracefully fallback to HTTP/1.1 when HTTP/2 is not supported by the API. HTTP/2 improves performance by adding support for; multiplexing, header compression, and server push.
165
+
V2 adds [HTTP/2](https://httpwg.org/specs/rfc7540.html) support for supported API endpoints. The module will gracefully fallback to HTTP/1.1 when HTTP/2 is not supported by the API. HTTP/2 improves performance by adding support for; multiplexing, header compression, and server push.
0 commit comments