Hello,
I know I can get the name of all applied AD GP display names using:
(value “DisplayName” of it) of it whose (exists value “DisplayName” of it) of (it;keys of it; keys of keys of it; keys of keys of keys of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\GPO-List” of registry
But I am trying to query if a specific policy has been applied. Can someone point how how I could simply generate a Boolean result if a GP with Display Name “Acme Group Policy” is present?
Thanks!
I’m not sure why there is all of those it;keys of it; keys of keys of it…
But this should work:
Q: exists keys whose (value "DisplayName" of it as string = "Acme Group Policy" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\GPO-List" of registry
Essentially we write a query that pulls the key we want:
keys whose (value "DisplayName" of it as string = "Acme Group Policy" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\GPO-List" of registry
And put an Exists infront of it. This will be true if our query did return a key and false if the key didnt exist.
2 Likes
I found the same solution. I even went one deeper to ensure a specific GP was applied. Thanks Strawgate!