Product: PowerShell Universal Version: 4.1.10
When running a scheduled job in the 7.x env that connects to graph I get the error The system cannot find the file specified. when it attempts to connect to MSGraph.
If I manually connect in VSCode or right in a pwsh window as the user the job is scheduled to run as it connects without issue
Connect-MgGraph -ClientID $clientID -TenantId $tenantID -CertificateThumbprint $certThumbprint
The certificate is valid and is saved both in the local machine store as well as the user store
Here is what I do, which works in my environment.
Connect-MgGraph -ClientId $Secret:ClientID -TenantId $Secret:AzureTenant -Certificate (Get-Item $Secret:mgGraphCert) | Out-Null
$Secret:mgGraphCert is set to Cert:\LocalMachine\My\CERT_THUMBPRINT