-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
New-DbaComputerCertificate, options for Algorithm and Period validity #9264
New-DbaComputerCertificate, options for Algorithm and Period validity #9264
Conversation
Should resolve story I opened #9263 |
hi @daniel-merchant , everything looks fine. |
BTW, you miss a run of Invoke-DbatoolsFormatter for this file, or you can manually indent correctly lines 356-357 . |
Sorry about that. I will run the formatter and update (probably tomorrow now).
Apologies, this is one of my first commits to any public repository. Thank you for you patience. |
No worries, it's pratically perfect and there's no rush . Regarding tests... |
it fails with "Cannot bind argument to parameter 'Thumbprint' because it is null." so probably it was explicitely disabled because certificate generation does not work on appveyor, bummer. re-add the Last minor fix, please keep EnabledException as the last param |
@niphlod - I have moved EnableException to the last parameter and re-enabled the appveyor exclusions. Please do let me know if there is anything else I need to do here. Really appreciate the work that is put into these community tools. |
ok @daniel-merchant , failures in appveyor are unrelated |
Thank you both 🙇🏼 Will merge when tests approve |
Before this change, the command worked on my lab with a german locale. Now it does not because of the date format of NotBefore and NotAfter. I invested some minutes but have not found a solution. Does anyone have experienced the same problem? |
@andreasjordan , it very well may be but till we use certreq, we are in the realm of creating an .inf, whose specs just say """ |
I had no luck with month names. Tried a lot of date formats - nothing works. |
then it's more of a certreq.exe problem to solve before understanding how to do it within dbatools code. |
Does not work. Probably because of english names of periods. Too bad. We have to find a different way for the german systems. |
or we set the thread to english just before invoking certreq ?? |
Maybe we are looking at the wrong point. Have a look at the specs you linked:
But "RequestType=cert" is only used to self-signing certs. For the others, we use "RequestType = PKCS10", where these parameters are not allowed. So it's not the language but the parameter itself. I can successfully create a self-signed certificate with that command, but not a "normal" certificate issued by my lab-CA. |
The documentation is correct: "Allows you to specify the number of months a self-signed certificate will be valid for" So we only need to change the code to put the two lines in the if block. Will open a pull request for that. |
@andreasjordan sorry my changes broke this scenario. Should have checked the documentation better for those additional parameters. Thank you for fixing. |
Please read -- recent changes to our repo
On November 10, 2022, we removed some bloat from our repository (for the second and final time). This change requires that all contributors reclone or refork their repo.
PRs from repos that have not been recently reforked or recloned will be closed and @potatoqualitee will cherry-pick your commits and open a new PR with your changes.
-Apologies I really do not know how I would check this. I forked the latest development branch.
Type of Change
.\tests\manual.pester.ps1
)Purpose
Added Hashing Algorithm and Exipiry date options to New-DbaComputerCertificate
Approach
Added two variables to the New-DbaComputerCertificate function "HashingAlgorithm" and "MonthsValid"
Expanded tests to ensure default values are kept and that the new optional variables are respected.
Commands to test
New-DbaComputerCertificate
Learning
Apologies, I am not very familiar with GIT and not a regular contributor to DBATools. I have read the contributing guidelines and I hope this will be useful, but please let me know if this is not appropriate or needs some work and I am happy to take on any criticism.
Inspired as we are going to be implementing something something that is likely going to need these options.
This might be a popular request following this blog article:
https://www.brentozar.com/archive/2024/03/read-this-before-your-users-install-ssms-20/