• Updated dfstool v1.1 Now Available

    Posted on August 1st, 2011 Jorge Escala 21 comments

    After a great launch that included a mention in MacWorld’s Mac OS X Hints, I’ve decided to make my command line tool for querying and connecting to DFS shares from Mac OS X even better. After all, it was a 1.0 release so there was bound to be room for improvement. Thanks to everyone who provided feedback and suggestions.

    Here is a list of the new features and improvements in dfstool v1.1…

    – Add -u user switch
    – Fix -d domain controller switch
    – Change -h screen to use basepath variable
    – Add -f option to mount via the Finder
    – Revised option handling to better catch incorrect option and argument combinations
    – Check Mac OS X version to ensure it only runs on Snow Leopard 10.6

    And here is the obligatory sample output:

    ~ $ ./dfstool -h
    dfstool (1.1)
    (c) 2011 Jorge Escala <http://jescala.com/dfstool>
    usage: dfstool [option] [<dfspath>]
    options:
        -d <dc>        use <dc> domain controller to enumerate DFS shares
        -f             mount via the Finder using AppleScript
        -h             display this usage screen
        -l             display the complete dfs list
        -m <mntpnt>    mount the dfs path at <mntpnt>
        -M             mount the dfs path in ~/Network
        -u <username>  specify <username> for authentication
        -v             display version
    ~ $ ./dfstool -M '\\ad\dfs\shared\files'
    ~ $ df -h | tail -1
    //server/shared/files    1.3Ti  827Gi  551Gi    61%    /Users/jescala/Network/shared/files

    This code is available under the BSD license and can be downloaded here:

    dfstool-1.1.tgz
    MD5: 37901f848ef3f4d8bf25cd90bfd2931a
     

    21 responses to “Updated dfstool v1.1 Now Available” RSS icon

    • Thank your for making this utility, exactly what I need, I just have to find how to make it work in my workplace :-)

      The problem here, it seems to be, that “rpcclient –command=dfsenum 3″ does not return anything.

      First, workgroup command line option is missing, and there is no way to provide it through dfstool. So changed related rpcclient lines to include the missing –workgroup=XXX. This doesn’t help either. The output from rpcclient is:
      rpcclient $> dfsenum 3
      result was NT_STATUS_NOT_FOUND

      Regarding getting the AD DC automatically, found this article: http://technet.microsoft.com/en-us/library/bb727055.aspx, basically need to query DNS for _ldap._tcp.dc._msdcs. if I am not mistaken.

      I am not an expert on this :-) Will keep you updated if I make any progress.

      Thanks!

      • I should probably note that dfstool was developed and tested with DFS shares from an AD domain controller. However that is not to say it could not be made to work. Try using your DFS server with the “-d” switch instead of using a domain controller. Let me know if it works for you and I’ll update the “-h” help screen to reflect your findings.

        Regarding auto detecting the domain controllers using the DNS SRV records, I have thought about doing that, but the problem is that I can’t figure out a reliable way to detect what domain a Mac is joined to. I would need that in order to perform the DNS query. For example:

        $ dig _ldap._tcp.dc._msdcs.ad.domain.org SRV +short | egrep -v '^;;' | awk '{print $4}'
        DC1.AD.DOMAIN.ORG.
        DC2.AD.DOMAIN.ORG.
        DC3.AD.DOMAIN.ORG.
        

        In the above example, I need the “ad.domain.org” part. The only way I have found to do this on the Mac is with the “dsconfigad -show” command but that requires local admin rights. If you can think of a better way, I would really appreciate it!

        UPDATE: It just occurred to me that if the -d switch works with any DFS server, not just domain controllers, it would not make sense to try to auto-detect the DC and this may become pointless.

    • Peter Sommerlad

      Would dfstool also work, if a mac is not bound to the AD domain, i.e., local user? Today, cifs works with server names, but our IT department doesn’t support Macs but nevertheless introduces DFS in the next weeks. And I cannot yet upgrade to Lion on my main mac. I hope your tool can be of help, but while being a Unix guru (since the late 80s), I a complete newbie about how a Mac interacts with Windows, except for mounting smb/cifs shares in the “old way”.

      • Yes, dfstool can connect to SMB shares listed in a DFS namespace even if the Mac is not AD joined. DFS is basically a service that provides a directory of SMB shares on disparate servers all under a single hierarchical tree. In reality, the share is still a regular SMB share on a server somewhere. What dfstool does is provide a way to find records in the DFS namespace and identify where the SMB share is really located. After that it is just a regular SMB mount like you are used to. Since you are not AD joined, you will need to use the -u option to specify what username to use when authenticating. You will also want to use the -s option to point to the server running the DFS namespace service. In your case that will probably be any one of the AD domain controllers. For example:

        $ dfstool -u jescala -s dc.contoso.com '\\dfs\namespace\share'

        If you are just looking up a DFS record, you will be prompted for a password once. But if you want to perform a mount via dfstool, you will need to enter the password twice.

        BTW: Check out the beta of 1.2 on the dfstool homepage.

    • hi… need some assistance using the tool… i’m trying to utilize the tool with os 10.6.8 to mount a share, but i keep getting an error that the “dfstool: dfspath not found”… now i know the dfs is there. i’m able to connect to the same share using 10.7 and with an xp machine.

      my one liner is:
      ./dfstool -m /Volumes/myTestVolume ‘\\serverName\folderToMap’

      can someone please assist?

      • You probably need to specify a DFS root namespace server. Use the -s option. In my case the DFS server is any domain controller. You may want to try version 1.2 that is available as a beta on the dfstool homepage. That version includes a graphical interface and it allows you to set a default DFS server as well as other options.

        • i downloaded the new tool as well and typed in the dfs server name… as well as, stated the path.

          basically, i launch the app
          click about
          click config
          type the dfs server name
          click ok
          then, type the dfs address ex: \\serverName\folder

          still get unable to connect??? same with termina

    • i’ve cd’d into
      /Applications/DFS Mount.app/Contents/MacOS

      and ran the command
      ./applet -s serverName -u myUsername -l

      and the icon for the server popped up in the dashboard

      clicked on about
      clicked on config
      put the serverName in
      clicked ok

      typed the dfs address
      \\serverName\folder

      still received the error
      dfstool: dfspath not found

      i’m not sure if i’m missing something a bit basic??? seems awfully straightforward.

      • You should not be running the applet binary from the command line. All those options are for /usr/local/bin/dfstool. That should be in your path so you should not have to specify the whole path or cd to any directory. Try the following:

        dfstool -s servername -u username -l
        

    • didn’t get any errors when i navigated to /usr/local/bin and ran
      ./dfstool -s serverName -u myUsername -l

      so i then tried to mount dfs
      dfstool [-M [-s ] [-u ]] dfspath

      ./dfstool -M -s serverName -u myUsername ‘\\serverName\folder’
      and get a “dfstool: dfspath not found” error

      mounting to a mount point
      ./dfstool -m /Volumes/myTestVolume/ -s serverName -u myUsername ‘\\serverName\folder’
      and get a “dfstool: dfspath not found” error

      • You didn’t get any errors when you used the -l switch, but did you get any output at all? That should have listed all the DFS shares available from that DFS root namespace server. If you got no output from the -l command then you may not be using the correct server or something else is wrong.

    • I too am not seeing any output with the -l switch. Lion and my Windows boxes see it just fine. Any tips since last post?

      • OK, I figured out my issue. I was using the full “domain.local” section, and I cut that down to just “\\domain\share\”, and I made sure that I added the slash at the end, and that worked for me.

    • Hi,

      I am using macosx 10.6.8 and I have the same problem like matt from August 31st, 2011 at 18:00

      >dfstool -s servername -u username -l
      After asking for the password:
      dfstool: dfspath not found

      Servername is a DC fullname, the username is a AD username and the mac is not joined to AD.

      Do have any idee what may be wrong?
      (dfstool v1.2)

    • additional information: all the shares have a “$” at the end of their names.

    • Please forgive my ignorance in advance. I have downloaded this tool to help with dfs shares. Our organization recently went from using smb shares to a specific server location to a dfs and now our Macs will not connect. I ran the tool and received errors Line 17 unexpected EOF while looking for matching ” and Line 244: Syntax error : unexpected end of file. Logout Process completed. I changed in the exec dfs v1.1 file to a domain controller on our network.
      I never get a prompt that allows me to input any of the help items and if I try outside of the app. I get an error the app exec can not be found. I am not a Unix guru at all. So any help or explanation would be helpful.
      Thank You in advance for helping me understand how to use this tool and get it to work.

    • I am using 10.6.8, the machine is bound to AD.

      I ran the dfstool -s servername -u username -l and the box popped up. I hit about then config and entered the server. I received no output.

      When i try to mount i get dfspath not found.

    • I”m tryingthe beta as well, but since there’s no comments page for it I would like to post here.

      I can’t get anything besides “dfspath not found” when trying to use this. I prevously used ADmitMac but I’m trying to see if I can get by without the $$$ new version.

      This is the only line which gives me anything besides a blank stare:

      dig _ldap._tcp.dc._msdcs…com SRV +short | egrep -v ‘^;;’ | awk ‘{print $4}’

      This gives my expected list of domain controllers, including two I’ve seen before: mpaus01…com &
      mpaus02…com

      The command I’m using is this:
      dfstool -u -s ..com ‘\\MPAUS41\Work_files\ShareToMount\’
      which returns ‘DFSpath not found’.

      I also don’t get any results with this:
      dfstool -s ..com -u -l

      Thanks
      Darryl

    • Sorry, my clever angle-brackets were eaten in my comment, leaving “…” only!

      I’m trying beta 1.2 as well, but since there’s no comments page for it I would like to post here.

      I can’t get anything besides “dfspath not found” when trying to use this. I prevously used ADmitMac but I’m trying to see if I can get by without the $$$ new version.

      This is the only line which gives me anything besides a blank stare:

      dig _ldap._tcp.dc._msdcs…com SRV +short | egrep -v ‘^;;’ | awk ‘{print $4}’

      This gives my expected list of domain controllers, including two I’ve seen before:

      mpaus01…com &
      mpaus02…com

      The command I’m using is this:

      dfstool -u -s ..com ‘\\MPAUS41\Work_files\ShareToMount\’

      which returns ‘DFSpath not found’.

      I also don’t get any results with this:
      dfstool -s ..com -u -l

      Thanks
      Darryl

    • I’m trying beta 1.2 as well, but since there’s no comments page for it I would like to post here.

      I can’t get anything besides “dfspath not found” when trying to use this. I prevously used ADmitMac but I’m trying to see if I can get by without the $$$ new version.

      This is the only line which gives me anything besides a blank stare:

      dig _ldap._tcp.dc._msdcs.[group].[xyzxyz].com SRV +short | egrep -v ‘^;;’ | awk ‘{print $4}’

      This gives my expected list of domain controllers, including two I’ve seen before:

      mpaus01.[group].[xyzxyz].com &
      mpaus02.[group].[xyzxyz].com

      The command I’m using is this:

      dfstool -u -s [group].[xyzxyz].com ‘\\MPAUS41\Work_files\ShareToMount\’

      which returns ‘DFSpath not found’.

      I also don’t get any results with this:
      dfstool -s [group].[xyzxyz].com -u -l

      Thanks
      Darryl