(imported comment written by Steve91)
Hi Brolly/All
Sorry to drag this one up again but I’ve been using this retrieved property since I saw it (thanks by the way)
Just one query, it works fine if someone is logged on, and retrieves the logonserver correctly, but if the machine is logged off the property errors.
Instead of returning “Not Logged On” it just returns in the console (singular expression refers to nonexistant object)
I’ve tried incorporating it into an action script and the script executes fine when a user is logged in but fails at the first “if” statement after “//Determine correct GRC” if no one is logged in
I’m sure most of the problem is down to my syntax (example of some of the action script is displayed below), could you possibly advise please?:-
if {name of operating system = “WinNT”}
parameter “dirAVapp” = “C:\WINNT\Profiles\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5”
else
parameter “dirAVapp” = “C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5”
endif
parameter “logonServer” = “{if exists key (“HKEY_USERS” & name of (key whose ((it = name of current user as lowercase OR it starts with name of current user as lowercase & “@” ) of (it as string as lowercase) of value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it) of key “HKEY_USERS” of registry) & “\Volatile Environment”) whose (exists value “LogonServer” of it) of registry then (value “LogonServer” of key (“HKEY_USERS” & name of (key whose ((it = name of current user as lowercase OR it starts with name of current user as lowercase & “@” ) of (it as string as lowercase) of value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it) of key “HKEY_USERS” of registry) & “\Volatile Environment”) of registry) as string else “Not Logged On”}”
//Determine correct GRC
if {parameter “logonServer” = “\GLASGOWDC1”}
appendfile copy “__Download\GRCDATS\Glasgow\GRC.dat” “{parameter “dirAVapp”}\GRC.dat”
elseif {parameter “logonServer” = “\BRADFORDDC1”}
appendfile copy “__Download\GRCDATS\Bradford\GRC.dat” “{parameter “dirAVapp”}\GRC.dat”
etc…
etc…
etc…
else
appendfile copy “__Download\GRCDATS\Miscellaneous\GRC.dat” "{parameter “dirAVapp”}\GRC.dat
endif
copy __appendfile copygrc.dat
dos start /min copygrc.dat
I was expecting the above to copy the relevant GRC.dat file if the logonserver value was returned and to copy the “Miscellaneous” GRC if “Not Logged On” was returned but it doesn’t seem to work that way if no one is logged on, because the “Not Logged On” value is not returned.
Hope this makes some sense and grateful for any advice
Cheers
Steve