Accessing file or folder from a mapped network drive

(imported topic written by rmustapha91)

I’m trying to see if there is anyway to access a file from a mapped network drive. For example, let say I mapped \raf-fileshare\rtemp to M: and inside the drive is a file called “home.html”

Is there any relevance I can use to check if this drive is mapped and check for the existence of the file? Thanks

Below is what I have to check for network drive existence

q: if (value “RemotePath” of key “Network\M” 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)) = “\raf-fileshare\rtemp” then “Audit Passed - M: is mapped to \raf-fileshare\rtemp” else “Audit Failed - M: is not mapped to \raf-fileshare\rtemp”

(imported comment written by BenKus)

Hi ralph,

I believe this will work in theory… but the SYSTEM account will need permission to access the folder:

exists file “\raf-fileshare\rtemp\home.html”

Important notes:

  • The agent runs as the SYSTEM account and won’t have access to shares unless you make them a “null session share”… I am not sure if this is compatible with your security requirements.

  • This relevance would cause the agents to check for this file periodically… be careful if you think that will cause too much load on your servers.

Ben

(imported comment written by rmustapha91)

Thanks