How to create Custom Fixlet for the changing the Spooler registries?

Hello folks. COuld you please help me to create the Custom Fixlet for the below requirement?

1.Rename-Item -Path “c:\Windows\System32\GroupPolicy\Machine\Registry.pol” -NewName "Registry_pol_hold.txt

2.Rest the register key RegisterSpoolerRemoteRpcEndPoint to Zero , DisableHTTPPrinting ,

3.Restart the Print Spooler (C:\Windows\System32\spoolsv.exe)

4.gpupdate /force

===============

This is the Script :slight_smile:

2012
rename c:\Windows\System32\GroupPolicy\Machine\Registry.pol Registry_pol_hold.txt
reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v RegisterSpoolerRemoteRpcEndPoint /t REG_DWORD /d 0 /f
net stop spooler
net start spooler
Gpupdate /force

2016
rename c:\Windows\System32\GroupPolicy\Machine\Registry.pol Registry_pol_hold.txt
reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v DisableWebPnPDownload /t REG_DWORD /d 0 /f
reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v DisableHTTPPrinting /t REG_DWORD /d 0 /f
net stop spooler
net start spooler
Gpupdate /force .

Can you please help me with how can we make it in the relevance language in the BigFix. Thanks

If I was doing this with action script then I would probably do it like this:

 action uses wow64 redirection false

//Actions for Windows 2012 Servers
if {windows of operating system and name of operating system as lowercase contains "2012"}
 
//Change the File Name
if {exists file "c:\Windows\System32\GroupPolicy\Machine\Registry.pol"}
waithidden copy "c:\Windows\System32\GroupPolicy\Machine\Registry.pol" "c:\Windows\System32\GroupPolicy\Machine\Registry_pol_hold.txt"
delete "c:\Windows\System32\GroupPolicy\Machine\Registry.pol"
endif

//Verify file has been changed
continue if {exists file "c:\Windows\System32\GroupPolicy\Machine\Registry_pol_hold.txt"}

//Create Registry Key
waithidden cmd.exe /C reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v RegisterSpoolerRemoteRpcEndPoint /t REG_DWORD /d 0 /f

//Restart Spooler Service and Force Group Policy Update
if {exists running service "spooler"}
waithidden cmd.exe /C net stop spooler
waithidden cmd.exe /C net start spooler
waithidden cmd.exe /C gpudate /force
endif

//Actions for 2016 Servers
elseif {windows of operating system and name of operating system as lowercase contains "2016"}

//Change the File Name
if {exists file "c:\Windows\System32\GroupPolicy\Machine\Registry.pol"}
waithidden copy "c:\Windows\System32\GroupPolicy\Machine\Registry.pol" "c:\Windows\System32\GroupPolicy\Machine\Registry_pol_hold.txt"
delete "c:\Windows\System32\GroupPolicy\Machine\Registry.pol"
endif

//Verify file has been changed
continue if {exists file "c:\Windows\System32\GroupPolicy\Machine\Registry_pol_hold.txt"}

//Create Registry Keys
waithidden cmd.exe /C reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v DisableWebPnPDownload /t REG_DWORD /d 0 /f
waithidden cmd.exe /C reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers” /v DisableHTTPPrinting /t REG_DWORD /d 0 /f

//Restart Spooler Service and Force Group Policy Update
if {exists running service "spooler"}
waithidden cmd.exe /C net stop spooler
waithidden cmd.exe /C net start spooler
waithidden cmd.exe /C gpudate /force
endif
endif

You could add in a lot more exit codes and verification’s but this is just rough and there’s someone out there who would probably simplify this too :smiley:

Thanks, John. It is really helpful

1 Like