Connect-MgGraph : ClientCertificateCredential authentication failed: The certificate certificate does not have a private key.
Bojan Zivkovic
606
Reputation points
Hi, PS code connecting to MS Graph works fine (inside scheduled task) when run as user is domain admin account:
Connect-MgGraph -TenantId $TenantID -AppId $AppID -Certificate $Cert -NoWelcome
However, when scheduled task is running under gMSA having even full permissions on certificate private key, Connect-MgGraph line above always fails:
Connect-MgGraph : ClientCertificateCredential authentication failed: The certificate certificate does not have a private key.
We always prefer to use gMSAs for scheduled tasks so sorting this out would be great.
Microsoft Security | Microsoft Graph
13,728 questions
Sign in to answer