You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Connect-graph: Value cannot be null, Parameter name: certificate #52
Im able to get information via the app-registration using the Invoke-RestMethod -Headers $Headers -Uri "https://graph.microsoft.com/v1.0/users/$UserPrincipalName/photo" -Method Get
Which means that the app registration and permissions are ok, perhaps I need to create a certificate another way?
The error indicates that the certificate was not found in cert:\CurrentUser\My, or it may have expired. Could you verify that the certificate is present in cert:\CurrentUser\My by running Get-ChildItem -path "cert:\CurrentUser\My" | Where Subject -EQ "CN=MyCompanyName". If it is present, then check its expiry date by running Get-ChildItem -path "cert:\CurrentUser\My" | Where Subject -EQ "CN=MyCompanyName" | Select Subject, NotAfter, and ensure NotAfter is > today's DateTime.
I was battling with the same issue, and indeed, I my certificate was in the localmachine, not in the current user. Other thing, I did export the certificate wihout keys, and uploaded in azuread into my app. Finally I got connected.
This helped me.. I was clueless on why the cert was failing error "certificate was not found or has expired" No logs were logged in CAPI which corresponds to the cert I am using.. Adding the cert to users store fixed the issue. That explained why it was failing with no cert found.
Trying to connect mg-graph via a certificate returned from my azure key vault. This runs fine locally but when i run it under an automation account, i get an error stating that the certificate has expired or not found. What might be causing this ? I know for sure that the certs are valid and work great when called locally.
Activity
GSGBen commentedon Nov 20, 2019
I'm getting this as well.
peombwa commentedon Nov 25, 2019
The error indicates that the certificate was not found in
cert:\CurrentUser\My, or it may have expired. Could you verify that the certificate is present incert:\CurrentUser\Myby runningGet-ChildItem -path "cert:\CurrentUser\My" | Where Subject -EQ "CN=MyCompanyName". If it is present, then check its expiry date by runningGet-ChildItem -path "cert:\CurrentUser\My" | Where Subject -EQ "CN=MyCompanyName" | Select Subject, NotAfter, and ensure NotAfter is > today's DateTime.iaragon76 commentedon Jun 1, 2020
I was battling with the same issue, and indeed, I my certificate was in the localmachine, not in the current user. Other thing, I did export the certificate wihout keys, and uploaded in azuread into my app. Finally I got connected.
milan-mb commentedon Jun 9, 2020
This helped me.. I was clueless on why the cert was failing error "certificate was not found or has expired" No logs were logged in CAPI which corresponds to the cert I am using.. Adding the cert to users store fixed the issue. That explained why it was failing with no cert found.
yuhup2edy commentedon Aug 6, 2021
Trying to connect mg-graph via a certificate returned from my azure key vault. This runs fine locally but when i run it under an automation account, i get an error stating that the certificate has expired or not found. What might be causing this ? I know for sure that the certs are valid and work great when called locally.