Skip to content

Instantly share code, notes, and snippets.

/LCM

Created March 1, 2016 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/bb5f809ac4c87ab8ee1e to your computer and use it in GitHub Desktop.
Save anonymous/bb5f809ac4c87ab8ee1e to your computer and use it in GitHub Desktop.
[DSCLocalConfigurationManager()]
Configuration LCM_ConfigName
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
#[Parameter(Mandatory=$true)]
#[string]$guid, <------------------------Dont need this anymore
[Parameter(Mandatory=$true)]
[string]$ThumbPrint
)
Node $ComputerName {
Settings {
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
ConfigurationID = "" # Setting to blank - but can leave a guid in - won't matter
}
ConfigurationRepositoryWeb DSCHTTPS {
ServerURL = 'https://DSC.company.pri:8080/PSDSCPullServer.svc'
CertificateID = $Thumbprint
AllowUnsecureConnection = $False
RegistrationKey = "1234567" # <----------- We Need this
ConfigurationNames = @("RoleSNMP") # <----------- We Need this - only one role!
}
}
}
$Thumbprint=Invoke-Command -Computername dc {Get-Childitem Cert:\LocalMachine\My | Where-Object {$_.FriendlyName -like "*wild*"} | Select-Object -ExpandProperty ThumbPrint}
# Create the Computer.Meta.Mof in folder
LCM_ConfigName -ComputerName s2 -Thumbprint $Thumbprint -OutputPath .\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment