Discussion:
How can I discover a DFS target from a DFS link through an API call?
(too old to reply)
Andy Dotson
2004-10-12 23:34:35 UTC
Permalink
Good afternoon, I've got what I would think is a simple problem.

I've got this DFS head that has say 4 backend servers on it. What I
want to be able to do, is to programically determine the backend file
path from a DFS head link.

For example:

\\dfsmachine\someshare\FooBar actually links to:
\\dfsmachine3\c$\FooBar.

How can I discover the target (2nd line) by knowing the link?? I've
experimented already with the NetDFS API functions...but these only
return me information about the Entry Path (the 1st line). Neither
NetDfsGetInfo or NetDfsGetClientInfo returns me the actualy target.

Am I doin somethin wrong? Is there another API I can use to do this?
It sounds so simple an issue...yet it's eluding me.

Any help is greatly appreciated (I'm writing the code in C# through
pinvoke, however I know a suitable amount of C++ as well).
Andy Dotson
2004-10-13 17:37:19 UTC
Permalink
I should also note that I'm asking about Win2K machines. I know that
with Win2K3 you can easily use WMI...
Post by Andy Dotson
Good afternoon, I've got what I would think is a simple problem.
I've got this DFS head that has say 4 backend servers on it. What I
want to be able to do, is to programically determine the backend file
path from a DFS head link.
\\dfsmachine3\c$\FooBar.
How can I discover the target (2nd line) by knowing the link?? I've
experimented already with the NetDFS API functions...but these only
return me information about the Entry Path (the 1st line). Neither
NetDfsGetInfo or NetDfsGetClientInfo returns me the actualy target.
Am I doin somethin wrong? Is there another API I can use to do this?
It sounds so simple an issue...yet it's eluding me.
Any help is greatly appreciated (I'm writing the code in C# through
pinvoke, however I know a suitable amount of C++ as well).
Dan Lovinger [MSFT]
2004-10-15 03:40:11 UTC
Permalink
NetDfsGetInfo *will* do this - use level 3 or 4. Just to make sure you get
to the right docs:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netdfsgetinfo.asp

The storage array (pInfo->Storage) will have the link targets.
--
Dan Lovinger
Microsoft Corporation
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
Post by Andy Dotson
I should also note that I'm asking about Win2K machines. I know that
with Win2K3 you can easily use WMI...
Post by Andy Dotson
Good afternoon, I've got what I would think is a simple problem.
I've got this DFS head that has say 4 backend servers on it. What I
want to be able to do, is to programically determine the backend file
path from a DFS head link.
\\dfsmachine3\c$\FooBar.
How can I discover the target (2nd line) by knowing the link?? I've
experimented already with the NetDFS API functions...but these only
return me information about the Entry Path (the 1st line). Neither
NetDfsGetInfo or NetDfsGetClientInfo returns me the actualy target.
Am I doin somethin wrong? Is there another API I can use to do this?
It sounds so simple an issue...yet it's eluding me.
Any help is greatly appreciated (I'm writing the code in C# through
pinvoke, however I know a suitable amount of C++ as well).
Loading...