when i try to connect using client secret i am getting error.
: Cannot bind parameter 'ClientSecretCredential'. Cannot convert the "mysecret" value of type "System.String" to type "System.Management.Automation.PSCredential".
At line:1 char:129
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to connect to Azure MS Graph using an Azure Service Principal. How can I generate a certificate for the Azure Service Principal? I have the Client ID and Tenant ID. I need to fetch users information from Azure AD, and I have the required Graph API permissions. Can I connect using a client secret instead of a certificate
Connect-MgGraph -ClientId “{clientID}” -TenantId “{TenantID}” -CertificateThumbprint “{Thumbprint}”
when i try to connect using client secret i am getting error.
: Cannot bind parameter 'ClientSecretCredential'. Cannot convert the "mysecret" value of type "System.String" to type "System.Management.Automation.PSCredential".
At line:1 char:129
Hello Roger Roger,
Thank you for reaching out to Microsoft Support!
You can connect using the client secret as follows:
$ClientSecretCredential = Get-Credential -Username "Client_Id"
# Enter client_secret in the password prompt.
Connect-MgGraph -TenantId "Tenant_Id" -ClientSecretCredential $ClientSecretCredential
Reference document:
https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/docs/authentication.md
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.