Delete the Registry value through the Group Policy

  • Thread starter Thread starter bensonlei
  • Start date Start date
B

bensonlei

Hi,

I want to delete the Registry Value through Group Policy.

I would like to consult you all the experts about my template:


------------- My Template -------------------------------
;
; delete the registry value = old SUS SID
;


CLASS MACHINE
CATEGORY !!RemoveSUSID
POLICY !!deleteregistryvalue
KEYNAME "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate"
VALUENAME "SusClientId"
END POLICY
END CATEGORY


CLASS MACHINE
CATEGORY !!RemoveSUSID
POLICY !!deleteregistryvalue
KEYNAME "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate"
VALUENAME "AccountDomainSid"
END POLICY
END CATEGORY


CLASS MACHINE
CATEGORY !!RemoveSUSID
POLICY !!deleteregistryvalue
KEYNAME "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate"
VALUENAME "PingID"
END POLICY
END CATEGORY


[strings]
RemoveSUSID="Remove the old SUS settings"
deleteregistryvalue="Delete the registry value for old SUS Server"


------------------------------------


What is wrong for the above template due to I can not do what I want ?


Thank you
Benson
 
Hi,

I want to delete the Registry Value through Group Policy.
[...]
POLICY !!deleteregistryvalue
KEYNAME "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate"
VALUENAME "SusClientId"
END POLICY

If you do it like this, without any information about what happens
if it is activated or deactivated, the GPEditor will always create
a Reg_Dword with Value "1" ad activated state and the value will be
deleted if it is set to deactivated.
So in your case you have to deactivate your policy.

If you would like to "delete" the value with an activated policy,
you can do it like this:

POLICY !!deleteregistryvalue
KEYNAME "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate"
VALUENAME "SusClientId"
VALUEON DELETE
END POLICY

Mark
 
Back
Top