Jump to content

Get list of shares on remote server


kyo
 Share

Recommended Posts

Greetings,

I'm trying to get a list of what appears to be shared folders on a remote server.   All my attempts to get that list have failed so far.

I've tried getting a list of folders with _FileListToArrayRec() - I can do that on most remote servers, but not this particular one.

Now for the particularities of that... particular system: It's an Avid ISIS 7000 system (yes, they're changing the name in the next generation). 

There are two servers running in a cluster, and network resources are made available through a virtual name. 

If I open Windows Explorer and go to the virtual name (let's say it's \\virtual), I can see hundreds of items with a description of "Share".  Those are the ones I can't get a list of.

At the command line I can't list \\virtual either, and net view \\virtual /All responds with error 53.

But if I already know one of the folder's name, I can access it easily and get the folder's contents with a call to _FileListToArrayRec().  Ex: \\virtual\folder1 will work, and I will get the list of everything contained within that folder.

Is there any method I'm not aware of to determine what kind of shared resource these folders are (because they don't behave like regular shared folders), or is there a method I could use to get that darned list?  Any method, any language (Python, C ...) will do, as long as I can call it from AutoIt,

What bugs me is that I can see the list of folders in Windows Explorer or in FreeCommander, but I can't get if with AutoIt. 

Any ideas?  Or if I wasn't clear in my explanations, please let me know.  English is not my native language, so sometimes it's not easy to translate a clear picture..

Thanks!

Edited by kyo
Link to comment
Share on other sites

mmm... try typing the IP address \\ip machine and check if your machine have the permission to do it because System error 53 It means that the server refuses your computer connection.

PS:It is not the right section to ask this

Link to comment
Share on other sites

If I try and type the IP address for the virtual name in a command box (opened with Win+R), Windows Explorer opens with the folders listed. 

If I do the same at a command prompt with something like net view \\10.10.10.10 /All, it does not work either.

I'm sorry if this is not the correct sub-forum for this thread, I trust a moderator will move the thread if it's the case.

Thanks!

Link to comment
Share on other sites

Sorry about the delay, I was off work for a few days.

The command net view \\virtualname /All

returns Error 53 - note that I have full access to those resources, as I'm one of the admins.

I have a feeling I'm not getting out of this...  but thanks for the help!

Link to comment
Share on other sites

3 hours ago, kyo said:

... as I'm one of the admins.

you keep using that word, i do not think it means what you think it means. ;)

first, try:  _Net_Share_ShareEnum()

this may not work because, as per help file - "Administrator, Power User, Print Operator, or Server Operator group membership is required to execute this function.". if it does not work, then you may be an admin of the domain, but not an admin for the specific target (computer or resource).

i think it would be helpful to know what OS is your target running, and how is it joined to your Active Directory domain (or if you use AD at all). the resolution may vary upon answering these details.

regardless, be aware that AutoIt is a great tool, but relies on Windows infrastructure; if you cannot net view the shares, most likely AutoIt won't be able either. eventually, you may need to contact technical support, there may be some specific configuration you need to set.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

On 2016-11-10 at 3:57 AM, orbs said:

you keep using that word, i do not think it means what you think it means. ;)

 

After 32 years, yeah, I do. Well, at least I can pretend I do.  :)

Unfortunately this is not a simple system.  The Avid ISIS is a storage system for video production.  In front of it there are two Windows servers running as a cluster, which are used as what best could be described as the "FAT" of the filesystem, which itself is stored on independent storage blades which are all running a custom version of the Linux kernel.  On those Windows server runs an Avid software that defines that particular system.  The virtual name I'm referring to is the name given in that software.  Yes, both servers are members of our corporate-wide AD structure.  To access this storage you need the AvidFosFS service running, and authentication is done through another Avid software called Avid ISIS Client Manager.  The items I'm trying to get a list of are called Workspaces, and those are defined in the ISIS Administration console.  They are dynamically-sized "folders" used for different purposes.

I tried the _Net_Share_ShareEnum function again a few seconds ago, and while it does not return an error, I only get an empty array.  I executed the same test on the master of the cluster, with the exact same results.  The account used is local admin on both machines used in the test, and on the Avid and ISIS side the account I'm using is also admin.

I had to press on with that particular project, so while I'm still trying to figure out how to get the list of workspaces, it has gone to the back burner for now.  What bugs me is that I can see them in Windows Explorer, and that tells me it's possible.

As for asking technical support...  Avid probably won't help since I'm going around the system to compensate for serious shortcomings.  Internally, we're the tech support. ;-)

Thanks for the help, I'll let you know if I find something.

Link to comment
Share on other sites

On 2016-11-10 at 5:26 AM, j0kky said:

Little question to be added to orbs suggestions: when you type in command line only

net view

do you see the computer you call "virtualname"?

No I don't.  But then again I only see a small amount of the hundreds of servers surrounding me, and I can access them all.

Thanks for the help

Link to comment
Share on other sites

On 11/12/2016 at 9:01 AM, kyo said:

To access this storage you need the AvidFosFS service running, and authentication is done through another Avid software called Avid ISIS Client Manager.

are these components (or any one of them) installed on every client workstation, or only on the servers?

i remember reading somewhere in the Avid documentation that clients can access the workspaces using Windows internal API, so no need to deploy a proprietary client. if you have deployed a proprietary client, it may explain the behaviour.

i suggest, in parallel to trying to analyze the behaviour, to attempt a workaround. since Windows Explorer can list the workspaces, let AutoIt utilize Windows Explorer and make it retrieve the wokspaces list for you. this should prove adequate:

also, i wonder how do other file managers behave? care to try any of these?

Edited by orbs

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

4 hours ago, orbs said:

are these components (or any one of them) installed on every client workstation, or only on the servers?

They're installed just about everywhere - the AvidFosFS at least.  On the 700+ workstations they all have it, and on editing suites and all servers the ISIS Client Manager is also installed. 

4 hours ago, orbs said:

i remember reading somewhere in the Avid documentation that clients can access the workspaces using Windows internal API, so no need to deploy a proprietary client. if you have deployed a proprietary client, it may explain the behaviour.

You have to have at least the AvidFosFS service installed, else you can't access the workspaces at all - but yes it goes through Windows internal functions.  The 700+ workstations I mentioned had to be configured that way.  The proprietary client is Avid's own, and is required for advanced functions.

4 hours ago, orbs said:

i suggest, in parallel to trying to analyze the behaviour, to attempt a workaround. since Windows Explorer can list the workspaces, let AutoIt utilize Windows Explorer and make it retrieve the wokspaces list for you. this should prove adequate:

It's an interesting option that I've not explored yet.  I had found the threads implementing Windows Explorer's right pane, but not this.  Thanks, I'll check that out later tonight.  Another option I found is Sylvain Maziere's Python code that mimicks the conversation between the ISIS Management Console and the ISIS itself.  It might be the push I need to finally write more than a few hundred lines in Python and really learn the darn thing! :-)

Thanks again for your help, I'll let you know how it all turns out.

4 hours ago, orbs said:

also, i wonder how do other file managers behave? care to try any of these?

I have a portable version of FreeCommander stashed somewhere on my workstation, I can't remember though if I ever browsed the ISIS with it.  I guess not, because I use it mostly on my laptop and it doesn't have access to the ISIS reliably.  I'll check that too as soon as I get back to work.

Link to comment
Share on other sites

@orbs

I've tried FreeCommander and I'm able to access the workspaces on the ISIS.  It's very slow once I get two folders down - really slow, but it works.  Anyways, I'm never navigating like this.  Once I know the names of the workspaces, I can directly access the subfolders I have to work on.

I looked at the code in thread you mentioned (Automating Windows Explorer), and I'll have to dig into in in details in order to understand how the code works.  I've not been able to access the ISIS with that yet.  From what I've seen I might be able to get a list of the "folders" from the example code, but as I mentioned, I'll have to understand the code before using it.

Thanks for the hints!

Link to comment
Share on other sites

I've tried some of the code included in the Automating Windows Explorer thread, and so far I've hit the same wall: I can't list the folders at the first level.  The GetCurrentFolder example for instance, returns an empty MsgBox.  Not only on the ISIS, but on a local utility server we have (Windows 2012 R2 Standard) and I can access the subfolders just fine, but I can't list the shares displayed in Windows Explorer when I go to \\servername.  If I go to \\servername\some_share then it works. 

Still, I'll continue to explore in that direction...

Edited by kyo
Precisions
Link to comment
Share on other sites

On 11/14/2016 at 6:22 AM, kyo said:

I've tried FreeCommander and I'm able to access the workspaces on the ISIS.  It's very slow once I get two folders down - really slow, but it works.

if there are many items and subitems, slowness might be an expected scenario. i'd be happy if you could test with other file managers, the link i provided lists several, all portable and freeware.

 

On 11/14/2016 at 10:09 AM, kyo said:

I've tried some of the code included in the Automating Windows Explorer thread, and so far I've hit the same wall: I can't list the folders at the first level.

in second thought, it might be better to use Windows Explorer itself, rather than getting into the bits and bytes of setting up the interface yourself. you might find this topic more suitable:

i mention this because Windows Explorer uses a class titled DirectUIHWND, which is not accessible with AutoIt native functions (unless you are using Windows XP, which uses SysListView32, which makes it all a lot simpler).

personally i never used it, since i rarely do 3rd-part apps automation, and when i did, i managed it all with native AutoIt functions. but i recon there is a good potential there for your case.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

On 2016-11-15 at 4:07 PM, orbs said:

if there are many items and subitems, slowness might be an expected scenario. i'd be happy if you could test with other file managers, the link i provided lists several, all portable and freeware.

I'll try and test a few others tomorrow night if I can.

Quote

in second thought, it might be better to use Windows Explorer itself, rather than getting into the bits and bytes of setting up the interface yourself. you might find this topic more suitable:

i mention this because Windows Explorer uses a class titled DirectUIHWND, which is not accessible with AutoIt native functions (unless you are using Windows XP, which uses SysListView32, which makes it all a lot simpler).

personally i never used it, since i rarely do 3rd-part apps automation, and when i did, i managed it all with native AutoIt functions. but i recon there is a good potential there for your case.

Maybe, but after spending that much time on that particular problem I'm not sure if it's still worth it.  I mean, I know the names of all the workspaces so I could hardcode them all - which would be a problem once or twice a production season.

I can also get the workspaces from an ISIS snapshot - we take a snapshot before restarting any of our production systems, so they're quite up to date in that regard.  It's not "live" information, but it works.

For the indexed workspaces (those present in the Media Indexer's configuration) it's just a matter of getting the info from the Media Indexer itself, which is easy and what I've been doing for 4-5 years now.  I just wanted to get a list of all workspaces created in ISIS for a particular job.  That job is done now, and I was working on this to see if it was technically possible; it probably is, but right now the priority is (as always) another problem.  If I can find a solution between emergencies and crashes, I'll be happy though!

Thanks for the help.

Edited by kyo
Grammar
Link to comment
Share on other sites

I don't know anything about Avid ISIS or how to get the workspaces list on the ISIS.  Searching I found a forum talking about ISIS workspace list and someone  found a way to get all workspace names using three win32 functions (WNetOpenEnum, WNetEnumResource and WNetCloseEnum) that will do the job.   You can try to use KaFu enumerate network resources

Avid Community

http://community.avid.com/forums/p/71841/402944.aspx#402944

http://community.avid.com/forums/p/71841/403390.aspx#403390

 

 

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

On 2016-11-17 at 10:31 AM, Danny35d said:

I don't know anything about Avid ISIS or how to get the workspaces list on the ISIS.  Searching I found a forum talking about ISIS workspace list and someone  found a way to get all workspace names using three win32 functions (WNetOpenEnum, WNetEnumResource and WNetCloseEnum) that will do the job.   You can try to use KaFu enumerate network resources

I found that post in the Avid support forums too, but I haven't been able to contact Udo Sauer yet. 

I also tried code similar to the one in the thread you mention (the one with KaFu's code), but unfortunately it seems you can only enumerate network resources attached to the machine you are executing the code on.  I could use the method to enumerate all resources on the network, but with an infrastructure as large as ours it might be impossibly slow to get a list.  What I would need is a way to specify where those resources are offered, and get a list in return.

Thanks for the help, it's appreciated.

Link to comment
Share on other sites

5 hours ago, kyo said:

I could use the method to enumerate all resources on the network, but with an infrastructure as large as ours it might be impossibly slow to get a list.  What I would need is a way to specify where those resources are offered, and get a list in return.

I didn't read KaFu's code, but have you tried to setting up accordingly the lpRemoteName parameter of NETRESOURCE structure in the first WNetOpenEnum call?

Quote

lpRemoteName

Type: LPTSTR

If the entry is a network resource, this member is a pointer to a null-terminated character string that specifies the remote network name.

 

Edited by j0kky
Link to comment
Share on other sites

On 2016-11-19 at 5:05 AM, j0kky said:

I didn't read KaFu's code, but have you tried to setting up accordingly the lpRemoteName parameter of NETRESOURCE structure in the first WNetOpenEnum call?

No, you're right I didn't see that.  I'll try this as soon as I can.  We're currently swamped with (another) Avid database crash this week..  I'll try this as soon as I can and report back.. 

 

Again, thanks for the help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...