Hi
I am trying to create av property that will find the windows update setting in the registry. The problem is there are different places in the registry that tell the setting on different servers. I have created 3 statements for this.
-
Value of AUOptions in key HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU
-
Value of AUOptions in key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update
-
IF none of the 2 keys above exist and there exists a key HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU with value NoAutoUpdate = 1.
Building of @strawgate’s existing relevance query for this i created this
if exists (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU” of native registry) then (if(it = “1”) then (“Never check for updates.”) else (if(it = “2”) then (“Notify before download.”) else (if (it = “3”) then (“Automatically download and notify of installation.”) else (if (it = “4”) then “Automatic download and scheduled installation” else (if (it = “5”) then “Automatic Updates is required, but end users can configure it.” else “Value not recognized”))))) of (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU” of native registry as string)
else if exists (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” of native registry) then (if(it = “1”) then (“Never check for updates.”) else (if (it = “2”) then (“Notify before download.”) else (if (it = “3”) then (“Automatically download and notify of installation.”) else (if (it = “4”) then “Automatic download and scheduled installation” else (if (it = “5”) then “Automatic Updates is required, but end users can configure it.” else “Value not recognized”))))) of (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” of native registry as string)
else if not exists (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” of native registry) and not exists (value “AUOptions” of key “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU” of native registry) and exists key “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU” whose (value “NoAutoUpdate” of it as integer = 1) of native registry then “Never check for updates.”
else “N/A”
When i run on servers that fit the first if clause i get the intended result, but when they shoul hit the later if clauses it gets “Singular expression refers to nonexistent object.” I have tested this by running the relevance query torwards 1 statement and this works. This makes me think there is something wrong with the if structure. Does anyone have any tips?