Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct location of generated cert #4881

Open
wants to merge 1 commit into
base: Dev
Choose a base branch
from

Conversation

ketumbra
Copy link
Contributor

@ketumbra ketumbra commented Jul 15, 2024

The DSC scripts assume the certificate (specified by thumbprint) is in the localmachine store, not current user. Corrections to help output regarding use of both CertificatePath and CreateSelfSigned params.

Pull Request (PR) description

This PR addresses the above issues by generating the cert in the LocalMachine store and correcting the parameter comments.

This Pull Request (PR) fixes the following issues

The DSC scripts assume the certificate (specified by thumbprint) is in the localmachine store, not current user.
Corrections to help output regarding use of both CertificatePath and CreateSelfSigned params.
@@ -1714,7 +1714,7 @@ function Update-M365DSCAzureAdApplication
if ($CreateSelfSignedCertificate)
{
Write-LogEntry ' CreateSelfSignedCertificate specified, generating new Self Signed Certificate'
$cerCert = New-SelfSignedCertificate -CertStoreLocation 'Cert:\CurrentUser\My' `
$cerCert = New-SelfSignedCertificate -CertStoreLocation 'Cert:\LocalMachine\My' `
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part depends on what the intent is. If the user wants to do an Export, than the CurrentUser store is where the certificate should be placed. If it's a logic path using the LCM (e.g., Start/Test-DSCConfiguration) then LocalMachine is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but currently it does neither an export-pfx nor places it in a store for subsequent use. So as a new user, I cannot use this scriptlet to configure a service principal for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update-M365DSCAzureAdApplication creates certificate in wrong store
2 participants