(imported topic written by nberger91)
Any BES Guru’s out there know how to return this via a ‘retrieved property’ directly ?
I dont want to pipe a net use command to a txt file, then parse it …
Thanks !
(imported topic written by nberger91)
Any BES Guru’s out there know how to return this via a ‘retrieved property’ directly ?
I dont want to pipe a net use command to a txt file, then parse it …
Thanks !
(imported comment written by Steve91)
Hi
A question I asked a while ago
See here:
http://forum.bigfix.com/viewtopic.php?id=254
You’d adapt it to:
Q: if (exists current user) then (names of drives whose (type of it = “DRIVE_REMOTE”)) else “No Current User”
A: F:
A: G:
Or…
Q: if (exists current user) then (substrings after “=” of (selects “ProviderName from WIN32_LogicalDisk” of WMI as string)) else “No Current User”
A: \an\andfs
A: \an\andfs\homedirs4\g0790524
Or…
Q: if (exists current user) then ((substring after “=” of (property “Caption” of it as string) & " - " & substring after “=” of (property “Providername” of it as string)) of select objects “Caption, Providername from WIN32_LogicalDisk where Providername != NULL” of WMI as string) else “No Current User”
A: F: - \an\andfs
A: G: - \an\andfs\homedirs4\g0790524
Cheers
Steve
(imported comment written by nberger91)
This returns for the majority of clients, however if I run the logic through QnA locally, it returns the correct mappings.
Could this be because its run on the client as the system account ?
Is there a way to pull this via HKEY_USERS ?
Thanks
(imported comment written by Steve91)
My bad…
Do you have BES 7.0 clients nberger?
If so try this:
Q: if (exists current user) then (if (exists key “Network” whose (exists key whose (exists value “RemotePath” of it) of it) of (current user keys (logged on users) of registry)) then (((name of it as string) & ": - " & (value “RemotePath” of it as string)) of keys of key “Network” of (current user keys (logged on users) of registry) as string) else “No Mapped Drives”) else “No Current User”
A: F: - \an\andfs
A: G: - \an\andfs\homedirs4\g0790524
Note: You’ll need to run QnA under system account t to evaluate it, see first post here:
http://forum.bigfix.com/viewtopic.php?id=1909
This should work for version 6.0 clients:
Q: if (exists current user) then (if (exists key “Network” whose (exists key whose (exists value “RemotePath” of it) of it) 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)) then (((name of it as string) & ": - " & (value “RemotePath” of it as string)) of keys of key “Network” 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) as string) else “No Mapped Drives”) else “No Current User”
A: F: - \an\andfs
A: G: - \an\andfs\homedirs4\g0790524
Cheers
Steve
P.S. I believe the “Network” key under HKEY_USERS\SID is only populated with drive information if the drive is connected with the persistent option (i.e. reconnect at logon) or with NET USE (/persistent:yes)
(imported comment written by nberger91)
Awesome … thanks very much !
(imported comment written by wipro_ajerish91)
Thanks Steve was looking for this from very long time