Delete the Registry value through the Group Policy

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
 
M

Mark Heitbrink [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top