PowerShell DSC Pull and Push Mode Together

1k views Asked by At

I am using PowerShell 4.0 and configured a DSC Pull Server. Few clients are connected to the Pull Server and those are getting configurations properly. Below is the LCM details in a client machine: enter image description here

However, there are some times we would like to push a configuration to these clients. When I try to push, it is successful and the RefershMode gets changed to PUSH and all other settings are as it was before. Now from now onwards I don’t get any configuration from the Pull server anymore. Again I needed to change the mode to PUSH and it works fine.

Can both Pull and Push modes can be configured in the same client machine ? Will those work together ?

Thanks for your help!

1

There are 1 answers

5
briantist On BEST ANSWER

No, these modes cannot exist on the same machine; it's one or the other.

I have to question why you would want to do this. Presumably, if a machine is already in a Pull configuration, then the configuration you want to Push onto it must be different from what's on the Pull server. If that's the case, why would you want to then revert to Pull which would completely override the Push configuration?

Based on your comment, I would recommend that you change the configuration on the Pull server for the node(s) when you want to make changes. The process of generating the MOF files and the checksum files and then copying them to the Pull server can be automated. You can then use:

Invoke-CimMethod -Namespace root/Microsoft/Windows/DesiredStateConfiguration –ClassName MSFT_DSCLocalConfigurationManager -MethodName PerformRequiredConfigurationChecks -Arg @{Flags = [System.UInt32]1 } -ComputerName $targetNode 

to force the Node to pull and re-apply configuration.