I am trying to set registry keys, which contain hostname variables, across multiple computers. I can do this with a Push scenario, as shown by "Hey Scripting Guys - Use Configuration File to Apply PowerShell DSC to Multiple Servers", but when
I try to create a single mof file for pull clients the mof file does not contain all nodes specified in configuration data file.
I have included the Configuration Data psd1 file and the Configuration file ps1 below:
## Configuration Data.psd1
@{
# Node specific data
AllNodes = @(
@{
NodeName = "CP-DIAG-05"
}
@{
NodeName = "CP-CRIT-01"
}
);
NonNodeData = ""
}
## Client Pull Settings.ps1
Configuration SetClientPull {
Node $AllNodes.NodeName {
Registry AltDefaultDomainName {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "AltDefaultDomainName"
ValueData = "LMHS"
Force = 'True'
}
Registry AltDefaultPassword {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "AltDefaultPassword"
ValueData = "Password"
Force = 'True'
}
Registry AltDefaultUserName {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "AltDefaultUserName"
ValueData = $Node.NodeName
Force = 'True'
}
Registry AutoAdminLogon {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "AutoAdminLogon"
ValueData = "1"
Force = 'True'
}
Registry DefaultDomainName {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "DefaultDomainName"
ValueData = "LMHS"
Force = 'True'
}
Registry DefaultPassword {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "DefaultPassword"
ValueData = "Password"
Force = 'True'
}
Registry DefaultUserName {
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
ValueName = "DefaultUserName"
ValueData = $Node.NodeName
Force = 'True'
}
}
}
SetClientPull -ConfigurationData .\AllNodes.psd1 -OutputPath "."
$guid = [guid]::NewGuid().Guid
$source = ".\SetClientPull\*"
$dest = "C:\programdata\PSDSCPullServer\Configuration\$guid.mof"
Copy-Item $source $dest -Force
New-DSCCheckSum $dest