Hey Adam,
For the second one, it depends on how you executed the script.
If you run the script and provide the parameters, it should work as expected, like:
Sample_xDscWebServiceRegistrationWithSecurityBestPractices -RegistrationKey 2dd30223-3bcf-408c-8292-90036543bce2 -certificateThumbPrint 92FC2D86CC658E4547AF18E2DF54BA21B031B3F3
But if you try to use their code to generate the thumbprint and registration key, it fails because of a variable name mismatch. Under the first arguments block, the variable name is "$thumbprint", but in the configuration block, the variable name is "$certificateThumbPrint"
# ======================================== Arguments ======================================== #
$thumbprint = (New-SelfSignedCertificate -Subject "TestPullServer").Thumbprint
$registrationkey = [guid]::NewGuid()
# ======================================== Arguments ======================================== #
# =================================== Section DSC Client =================================== #
configuration Sample_xDscWebServiceRegistrationWithSecurityBestPractices
{
param
(
[string[]]$NodeName = 'localhost',
[ValidateNotNullOrEmpty()]
[string] $certificateThumbPrint,
[Parameter(HelpMessage='This should be a string with enough entropy (randomness) to protect the registration of clients to the pull server. We will use new GUID by default.')]
[ValidateNotNullOrEmpty()]
[string] $RegistrationKey # A guid that clients use to initiate conversation with pull server
)
Change $thumbprint to $certificateThumbPrint, and the script should execute successfully.
Note that with this script, you do not have to generate a certificate and registration key ahead of time, it generates them when you run the script. If you want to use your generated certificate and registration key...
Change these lines
# ======================================== Arguments ======================================== #
$certificateThumbprint = (New-SelfSignedCertificate -Subject "TestPullServer").Thumbprint
$registrationkey = [guid]::NewGuid()
to use your information
# ======================================== Arguments ======================================== #
$certificateThumbprint = 92FC2D86CC658E4547AF18D2DF54BA21B031B3F3
$registrationkey = 2dd30223-3bcf-408c-8192-90036543bce2
Let me know if this helps!
Mike Rodrick
Edutainer, ITProTV
**if the post above has answered the question, please mark the topic as solved.