Last active
May 8, 2024 07:49
-
-
Save invictus-korstiaan/74101206ddcb98dc6f95cc7952c3a0bc to your computer and use it in GitHub Desktop.
Connect to Graph APP
This file contains 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
$ClientId = "ID-of-your-app" | |
$TenantId = "ID-of-your-tenant" | |
$ClientSecret = "Secret-of-your-app” | |
# Convert the client secret to a secure string | |
$ClientSecretPass = ConvertTo-SecureString -String $ClientSecret -AsPlainText -Force | |
# Create a credential object using the client ID and secure string | |
$ClientSecretCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ClientId, $ClientSecretPass | |
# Connect to Graph | |
Connect-MgGraph -TenantId $tenantId -ClientSecretCredential $ClientSecretCredential |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment