Deploy Desired State Configuration Resources with an SMB based Pull Server
So you've either downloaded DSC resources from GitHub or you've created some DSC resources of your own and the LCM (Local Configuration Manager) on the servers in your environment is set to use an SMB based DSC pull server.
To automatically deploy those custom resources with an SMB pull server, they need to be zipped up
including their base directory and named ResourceName\_Version.zip
. For example, the xSmbShare
DSC resource that can be download from GitHub would be named xSmbShare\_1.0.zip
. In addition to
this, a checksum for that zip file needs to be created. The one for xSmbShare
would be named
xSmbShare_1.0.zip.checksum
.
I've created a module that contains several functions that is currently a work in progress that can be used to accomplish this task:
1Publish-MrDSCResourceToSMB -Name cMrSQLRecoveryModel, xSmbShare -SMBPath '\\DC01\DSCSMB'
You can see that both of the DSC resources that were specified in the previous command have been zipped up, the checksums created, the files have been named appropriately, and they have been uploaded to the SMB share that's being used as a DSC pull server:
1Get-ChildItem -Path \\DC01\DSCSMB
Based on the event logs of the server named SQL04, the cMrSQLRecoveryModel custom DSC resource was automatically downloaded from the DSC pull server and installed:
1Get-MrDscLogs -ComputerName SQL04 -MaxEvents 11 | Select-Object -ExpandProperty Message
The module that contains my DSC toolkit which I previously referenced as being a work in progress can be downloaded from GitHub.
µ