Last active
June 7, 2023 13:44
-
-
Save kevinblumenfeld/35c99b367eb1d5b0fe5c7357d5ee3e4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Usage | |
# GUI that saves and encrypts credentials that generate Bearer Token (Run this once per app registration) | |
# If application-only Graph API Permision, click "Export Tenant Config" button | |
# If also (or only) delegate permissions click both "Export Tenant Config" and "Export Tenant Credentials" buttons | |
# Copy the last command output from the GUI. This is how you connect each time. | |
Add-GraphConfig -Tenant Contoso -workload DescribePermissions | |
# GUI will provide exactly what to use to connect | |
Connect-Graph -Tenant Contoso -Workload DescribePermissions #use -Delegated switch if needed | |
## Gists | |
# Add-GraphConfig | |
https://gist.github.com/kevinblumenfeld/9fcc75db87b3519c922403a4ca5f8ae0 | |
# Connect-Graph | |
https://gist.github.com/kevinblumenfeld/3317bcae617da54c781e5849bccf1b99 | |
# Connect-GraphRefresh | |
https://gist.github.com/kevinblumenfeld/74ed39c87c233d258f9b4ec418607e10 | |
# use in functions | |
if ([datetime]::UtcNow -ge $RefreshTime) { Connect-GraphRefresh } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment