Skip to content

Commit

Permalink
Merge pull request #446 from microsoftgraph/dev
Browse files Browse the repository at this point in the history
1.1.0 Release
  • Loading branch information
peombwa authored Oct 26, 2020
2 parents 7240485 + f757249 commit b9fdfde
Show file tree
Hide file tree
Showing 124 changed files with 32,124 additions and 8,328 deletions.
3 changes: 1 addition & 2 deletions .azure-pipelines/generate-auth-module-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:
- task: CodeMetrics@1
displayName: 'Run CodeMetrics'
inputs:
Files: '$(System.DefaultWorkingDirectory)//**//*Microsoft.Graph*.dll;$(System.DefaultWorkingDirectory)//**//*Microsoft.Graph*.exe'
file: '$(System.DefaultWorkingDirectory)//**//*Microsoft.Graph*.dll;$(System.DefaultWorkingDirectory)//**//*Microsoft.Graph*.exe'
Files: '$(System.DefaultWorkingDirectory)//**//Microsoft.Graph.Authentication.dll;$(System.DefaultWorkingDirectory)//**//Microsoft.Graph.Authentication.exe'
continueOnError: true

- task: PowerShell@2
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/integrated-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ trigger:
- dev
- releases/*
- bugfixes/*
- features/*

stages:
- stage: ComputeVersion
Expand Down
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description | Module Name | PowerShell Gallery Link
----------------- | ----------------- | ------------------------
Microsoft Graph | `Microsoft.Graph` | [![Mg]][MgGallery]

For a list of modules found in this repository, see the [Microsoft Graph Graph PowerShell modules](https://github.com/microsoftgraph/msgraph-sdk-powershell/wiki/MS-Graph-PowerShell-Modules) document.
For a list of modules found in this repository, see the [Microsoft Graph PowerShell modules](https://github.com/microsoftgraph/msgraph-sdk-powershell/wiki/MS-Graph-PowerShell-Modules) document.

## Installation
### PowerShell Gallery
Expand All @@ -18,45 +18,45 @@ All the modules are published on [PowerShell Gallery](https://www.powershellgall
Install-Module Microsoft.Graph
```

If you are upgrading from our preview modules, run `Install-Module` with AllowClobber and Force parameter to avoid command name conflicts:
If you are upgrading from our preview modules, run `Install-Module` with AllowClobber and Force parameters to avoid command name conflicts:
```ps
Install-Module Microsoft.Graph -AllowClobber -Force
```
There are a set of samples in the `samples` folder to help in getting started with the library. If you have an older version of these modules installed, there are extra uninstall instructions in the [InstallModule](./samples/0-InstallModule.ps1) script.
There is a set of samples in the `samples` folder to help in getting started with the library. If you have an older version of these modules installed, there are extra uninstall instructions in the [InstallModule](./samples/0-InstallModule.ps1) script.

## Usage

1. Authentication

The SDK supports two types of authentication: delegated access, and app-oly access.
The SDK supports two types of authentication: delegated access, and app-only access.
- Delegated access via Device Code Flow.

```ps
Connect-Graph -Scopes "User.Read.All", "Group.ReadWrite.All"
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
```

- App only access via Client Credential with a certificate.
- App-only access via Client Credential with a certificate.

The certificate will be loaded from `Cert:\CurrentUser\My\` store. Ensure the certificate is present in the store before calling `Connect-Graph`.
The certificate will be loaded from `Cert:\CurrentUser\My\` store. Ensure the certificate is present in the store before calling `Connect-MgGraph`.

You can pass either `-CertificateThumbprint` or `-CertificateName` to `Connect-Graph`.
You can pass either `-CertificateThumbprint` or `-CertificateName` to `Connect-MgGraph`.

```ps
# Using -CertificateThumbprint
Connect-Graph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
```

or

```ps
# Using -CertificateName
Connect-Graph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
```

2. List users in your tenant.

```ps
Get-User -Top 10 -Property Id, DisplayName, BusinessPhones | Format-Table Id, DisplayName, BusinessPhones
Get-MgUser -Top 10 -Property Id, DisplayName, BusinessPhones | Format-Table Id, DisplayName, BusinessPhones
```

3. Filter a user in your tenant.
Expand All @@ -76,7 +76,7 @@ There are a set of samples in the `samples` folder to help in getting started wi
5. Sign out of the current logged-in context i.e. app only or delegated access.

```ps
Disconnect-Graph
Disconnect-MgGraph
```
## API Version
By default, the SDK uses the Microsoft Graph REST API v1.0. You can change this by using the `Select-MgProfile` command. This reloads all modules and only loads commands that call beta endpoint.
Expand All @@ -87,12 +87,15 @@ Select-MgProfile -Name "beta"

## Troubleshooting Permission Related Errors

When working with various operations in the Graph, you may encounter an error such as "Insufficient privileges to complete the operation." For example, this particular error can occur when using the `New-MgApplication` command if the appropriate permissions are not granted.
When working with various operations in the Graph, you may encounter an error such as "Insufficient privileges to complete the operation." For example, this particular error can occur when using the `New-MgApplication` command if the appropriate permissions are not granted.

If permission related errors occur and the user you authenticated with in the popup has the appropriate permissions to perform the operation try these steps.

- You can try running `Disconnect-Graph`, then `Connect-Graph`. Then, run the code that encountered the permission issues to see if it works.
- You can try running `Connect-Graph -ForceRefresh`. This will trigger a refresh of the access token in your cache. MSAL will only refresh the access token in your cache if it has expired (usually an hour), or if you explicitly refresh it via `-ForceRefresh`. Then, run the code that encountered the permission issues to see if it works.
- You can try running `Disconnect-MgGraph`, then `Connect-MgGraph`. Then, run the code that encountered the permission issues to see if it works.
- You can try running `Connect-MgGraph -ForceRefresh`. This will trigger a refresh of the access token in your cache. MSAL will only refresh the access token in your cache if it has expired (usually an hour), or if you explicitly refresh it via `-ForceRefresh`. Then, run the code that encountered the permission issues to see if it works.

## Known Issues
- If you attempt to run `Connect-Graph` from the PowerShell ISE (integrated scripting environment) the command fails with an error "Device code terminal timed-out after {X} seconds". This is a known issue and it is recommended to use a PowerShell host other than the ISE.

## Issues
If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue in our GitHub issues page.
Expand All @@ -109,4 +112,4 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT
[Mg]: https://img.shields.io/powershellgallery/v/Microsoft.Graph.svg?style=flat-square&label=Microsoft.Graph

<!-- PS Gallery -->
[MgGallery]: https://www.powershellgallery.com/packages/Microsoft.Graph/
[MgGallery]: https://www.powershellgallery.com/packages/Microsoft.Graph/
4 changes: 2 additions & 2 deletions config/ModuleMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"copyright": "© Microsoft Corporation. All rights reserved.",
"licenseUri": "https://aka.ms/devservicesagreement",
"projectUri": "https://github.com/microsoftgraph/msgraph-sdk-powershell",
"iconUri": "https://raw.githubusercontent.com/microsoftgraph/g-raph/master/g-raph.png",
"iconUri": "https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-powershell/po/release1.1.0/documentation/images/graph_color256.png",
"tags": "MicrosoftGraph;Microsoft;Office365;Graph;PowerShell;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK;",
"releaseNotes": "See https://aka.ms/GraphPowerShell-Release.",
"assemblyOriginatorKeyFile": "35MSSharedLib1024.snk",
"version": "1.0.1"
"version": "1.1.0"
}
4 changes: 2 additions & 2 deletions config/ModulesMapping.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Files": "^drives\\.|^shares\\.|^users.drive$|^groups.drive$",
"Financials": "^financials\\.",
"Groups": "^groups.group$|^groups.directoryObject$|^groups.conversation$|^groups.endpoint$|^groups.extension$|^groups.resourceSpecificPermissionGrant$|^groups.profilePhoto$|^groups.conversationThread$|^groupLifecyclePolicies\\.|^users.group$|^groups.directorySetting$|^groups.Actions$|^groups.Functions$",
"Identity.DirectoryManagement": "^administrativeUnits\\.|^contacts\\.|^devices\\.|^domains\\.|^directoryRoles\\.|^directoryRoleTemplates\\.|^directorySettingTemplates\\.|^settings\\.|^subscribedSkus\\.|^contracts\\.|^directory\\.|^users.scopedRoleMembership$|^organization.organization$|^organization.organizationalBranding$|^organization.organizationSettings $|^organization.Actions$|^organization.extension$",
"Identity.DirectoryManagement": "^administrativeUnits\\.|^contacts\\.|^devices\\.|^domains\\.|^directoryRoles\\.|^directoryRoleTemplates\\.|^directorySettingTemplates\\.|^settings\\.|^subscribedSkus\\.|^contracts\\.|^directory\\.|^users.scopedRoleMembership$|^organization.organization$|^organization.organizationalBranding$|^organization.organizationSettings$|^organization.Actions$|^organization.extension$",
"Identity.Governance": "^accessReviews\\.|^businessFlowTemplates\\.|^programs\\.|^programControls\\.|^programControlTypes\\.|^privilegedRoles\\.|^privilegedRoleAssignments\\.|^privilegedRoleAssignmentRequests\\.|^privilegedApproval\\.|^privilegedOperationEvents\\.|^privilegedAccess\\.|^agreements\\.|^users.agreementAcceptance$|^identityGovernance.entitlementManagement$|^identityGovernance.Functions$|^identityGovernance.Actions$",
"Identity.SignIns": "^organization.certificateBasedAuthConfiguration$|^invitations\\.|^identityProviders\\.|^oauth2PermissionGrants\\.|^riskDetections\\.|^riskyUsers\\.|^dataPolicyOperations\\.|^identity.identityUserFlow$|^trustFramework\\.|^informationProtection\\.|^policies\\.|^users.authentication$|^users.informationProtection$|^identity.conditionalAccessRoot$",
"Mail": "^users.inferenceClassification$|^users.mailFolder$|^users.message$",
Expand All @@ -26,7 +26,7 @@
"Search": "^search\\.|^external\\.",
"Security": "^Security\\.",
"Sites": "^sites.site$|^sites.itemAnalytics$|^sites.columnDefinition$|^sites.contentType$|^sites.drive$|^sites.list$|^sites.sitePage$|^users.site$|^groups.site$|^sites.Functions$|^sites.Actions$",
"Teams": "^teams\\.|^chats\\.|^users.chat$|^appCatalogs$|^users.userTeamwork$|^teamwork\\.|^users.team$|^users.userTeamwork$|^groups.team$",
"Teams": "^teams\\.|^chats\\.|^users.chat$|^appCatalogs.teamsApp$|^users.userTeamwork$|^teamwork\\.|^users.team$|^groups.team$",
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$",
"Users.Actions": "^users.Actions$",
"Users.Functions": "^users.Functions$"
Expand Down
Binary file added documentation/images/graph_color256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b9fdfde

Please sign in to comment.