(imported topic written by rmnetops91)
I have a property that returns the IE proxy settings on our machines. This works just fine, unless the user is logged off the machine, then it returns “Singular expression refers to nonexistent object.” or “” in my reports. Is there a way I can change the code below so if it errors out, it returns a static value that I define such as “No user logged on”?
if (name of operating system as lowercase starts with “win”) then if (exists value “ProxyServer” of key “SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry) AND (exists key “SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings” whose (value “ProxyEnable” of it as integer = 1) of current user keys (logged on users) of registry) then (value “ProxyServer” of key “SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry as string) else if (exists key “SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings” whose (exists value “AutoConfigURL” of it) of current user keys (logged on users) of registry) then "Automatic Configuration Script - " & (value “AutoConfigURL” of key “HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry as string) else “Not Enabled” else “Non-Windows Install”