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
It outputs a load of errors, indicating that the certificate can't be found. It seems like the export works fairly fine with a certificate in Cert:\\CurrentUser\My while retore require Cert:\\LocalMachine\\My:
Cannot find path '\LocalMachine\My\C2A6BF407F46E8EAA7C3FC7D182AE9E164AC1EB9' because it does not exist.
+ CategoryInfo : ObjectNotFound: (\LocalMachine\M...82AE9E164AC1EB9:) [], CimException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
+ PSComputerName : localhost
VERBOSE: [701AE4068A8E]: LCM: [ EndTest ] [[AADApplication]AADApplication-DSCtest] in9.3120 seconds.
PowerShell DSC resource MSFT_AADApplication failed to execute Test-TargetResource functionality with error message: Must specify 'CertificateThumbprint or CertificateName or Certificate'.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Cannot find path '\LocalMachine\My\C2A6BF407F46E8EAA7C3FC7D182AE9E164AC1EB9' because it does not exist.
+ CategoryInfo : ObjectNotFound: (\LocalMachine\M...82AE9E164AC1EB9:) [], CimException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
+ PSComputerName : localhost
PowerShell DSC resource MSFT_AADGroup failed to execute Test-TargetResource functionality with error message: Must specify 'CertificateThumbprint or CertificateName or Certificate'.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Verbose logs showing the problem
See above.
Suggested solution to the issue
Consistent certificate store support between export and restore.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Using Windows Server Core container, mcr.microsoft.com/windows/servercore:1809-amd64.
Version of the DSC module that was used ('dev' if using current dev branch)
1.23.412.1 Microsoft365DSC PSGallery This DSC module is used to configure and monitor Microsoft tenants, including SharePoint Online, Exchange, Teams, etc.
The text was updated successfully, but these errors were encountered:
That is because the Export process doesn't leverage the DSC engine and acts as a normal PowerShell script impersonating the current user whereas the Start-DSCConfiguration process starts a separate process that runs under the LocalSystem.
When doing an export, the certificate needs to be in the current user's store and for the deployment it needs to be in the Local System's one. It is unfortunately a limitation of how DSC works. One alternative option would be to add the PSDSCRunAsCredential parameter to every resource instance which will force the DSC process to impersonate the specified user and whcih I believe will make DSC look inside of that user's store instead.
Details of the scenario you tried and the problem that is occurring
I exported a clean developer tenant with default sample data using certificate thumbprint and Full mode:
Note that the certificate is imported to
Cert:\\CurrentUser\\My
.After workarounds for #3179, #3181, #3193 & #3182 (removed/renamed duplicates or invalid entries before convert) I ran a restore:
It outputs a load of errors, indicating that the certificate can't be found. It seems like the export works fairly fine with a certificate in
Cert:\\CurrentUser\My
while retore requireCert:\\LocalMachine\\My
:Verbose logs showing the problem
See above.
Suggested solution to the issue
Consistent certificate store support between export and restore.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Using Windows Server Core container,
mcr.microsoft.com/windows/servercore:1809-amd64
.The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
The text was updated successfully, but these errors were encountered: