Jump to content

DFS Target Mapping


 Share

Recommended Posts

$a = DriveGetDrive ("NETWORK")
For $i = 0 To UBound($a)-1
    ConsoleWrite(DriveMapGet($a[$i]) & @CRLF)
Next

or is it not a mapped drive?

If it's not mapped, you can run a command prompt with 'net use'...not sure if there is an autoit equivalent...parse the output.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

  • Moderators

@PaulP when you say "actual drive mapping" do you mean the Target Folder for each path, or the true path to the folder on the dfs server?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Okay, let me try this again but this time with pictures... If I do a DriveMapGet, it returns DFSROOT which isn't helpful.

I've attached what the drive looks like in Windows Explorer.

Explorer.jpg.b2b683b50b10a229819d12b83f52e60c.jpg

Just shows the Drive with no mapping.  Then, if I look at the properties.

Properties_General.jpg.9ce00a0bd4036bf1167798134e3501aa.jpg

What I want is the mapping that is shown in the DFS tab of the properties.

Properties_DFS.jpg.24f2fa71443892ca5d7a0ea8ce47b4fb.jpg

The "net use" also doesn't show my the actual drive mapping.

NetUse.jpg.bb146d23e7bd820de7b37a71c3c3e4e4.jpg

 

How do I get the actual drive mapping for a DFS Drive?  In short, I want to determine which server the drive is mapped to.

Edited by PaulP
Link to comment
Share on other sites

I have only worked with DFS a little bit, so I'm no expert. But I did a quick search and found dfsutil.exe might be useful and with that, the 'dfsutil property' command (with the 'state' subcommand) would most likely get you the information you need. You could use AutoIt to execute the program with parameters. I have no way of testing any of this right now, so I may be wrong. I hope this will help guide you.

Edited by abberration
Link to comment
Share on other sites

I am quite confident (but it remains untested on my part) that some of the Win32_ WMI class could answer your question.  Look at Win32_MappedLogicalDisk or Win32_LogicalDisk or some other class in that category.  You may find what you need.

Link to comment
Share on other sites

7 hours ago, Nine said:

I am quite confident (but it remains untested on my part) that some of the Win32_ WMI class could answer your question.  Look at Win32_MappedLogicalDisk or Win32_LogicalDisk or some other class in that category.  You may find what you need.

Nope, still shows as \\dfsroot\site\RetailApps for the ProviderName for both of these..

Edited by PaulP
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...