0

I am trying to retrieve a file off a Distributed File System (Microsoft)

\\int\GroupData\ITProSup\Operations Support\REMGROUP.txt

In order to have access to this DFS i need to input a user name and a password connecting to a DFS.

Now im trying to write a script in python to retrieve the file REMGROUP.txt from the DFS. I can't for the life of me find out a way of doing this that doesn't involve logging into the ftp server. Some modules I have found include

http://docs.pyfilesystem.org/en/latest/ftpfs.html#fs.ftpfs.FTPFS

https://docs.python.org/2/library/shutil.html

But neither of these refer to a way or have a method that takes a user name or password.

My question is does anyone know in python how to access a windows DFS that requires a user name and password to retrieve a file?

Justin S
  • 1,409
  • 4
  • 22
  • 38
  • The way I'm done something like this before is to call a dos command to connect a network share .. that avenue might help you. – Keith John Hutchison Jul 09 '14 at 20:32
  • dos net share command username password => https://www.google.com/search?q=dos+net+share+command+username+password&oq=dos+net+share+command+username+password – Keith John Hutchison Jul 09 '14 at 21:12
  • Ok so turns out that avenue doesn't entirely fix my issue. I'm looking for a way to connect to a DFS share without having to specify a server. My windows browser does not specify a server when connecting to the DFS share above. Why do i need to declare a server when doing it via script? – Justin S Jul 24 '14 at 05:06
  • Microsoft often hides a lot of stuff. There is probably some cmd line call you can use to determine what server owns what share. There would be some call going on to some active directory server somewhere. You could write a console app in c# that does the heavy lifting for you, and call that from python. – Keith John Hutchison Jul 24 '14 at 08:05
  • This got more complex quickly. I will have a dig around and see what I can come up with. Thanks for all the advice so far – Justin S Jul 30 '14 at 04:42

0 Answers0