Does anyone know of a way to search all active workstations in a windows domain for a file existence?
No single function to handle this. I suspect you would need to get a list of all the computers in the domain then search tem individually. What kind of access do you have to all the computers in the domain? Via Windows Share or FTP?
I have full access to all the computers using the windows share (c$).
To get started you will need to get a list of Servers. This can be accomplished using the Win32 Network Extender function wntResources2 or the using ADSI extender:
;List all servers in the current Domain
;Load Appropriate Extender
AddExtender("WWADS44I.DLL",0,"WWADS64I.DLL")
; Construct the full domain ADSI path.
ServerDn = dsGetProperty("LDAP://rootDSE", "serverName")
ServerName = ItemExtract(1, ServerDn, ",")
ServerName = ItemExtract(2, ServerName, "=")
ServerDn = dsGetProperty("LDAP://rootDSE", "defaultNamingContext")
ServerPath = "LDAP://%ServerName%/%ServerDN%"
sFilter = `(objectCategory=computer)`
MyOuPaths = dsFindPath(ServerPath, sFilter)
oucount = ItemCount(myoupaths,@TAB)
serverlist = ''
For x = 1 To oucount
ou = ItemExtract(x,myoupaths,@TAB)
objServer = ObjectGet(ou)
cn = objServer.CN
if serverlist == '' then serverlist = '\\': cn :'\C$'
else serverlist = serverlist : @TAB : '\\': cn :'\C$'
objServer = 0
Next
AskItemlist( 'Server list', StrTrim( serverlist ), @TAB, @UNSORTED, @SINGLE )
Exit
Now that you have a list of servers you can search each on for a file using the File Search Extender.
If you are just checking file existence and not also checking file contents, it would be best to use the File and Folder Finder extender instead of the Search extender. The FAF extender can handle long paths+filenames, were as the Search extender is limited to MAXPATH.