471,325 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Anyone had success using NetUseAdd() on shares accessed through aWindows 2003 DFS root?

Has anyone had success using NetUseAdd() on shares that were replica links on a Windows 2003 DFS root? In my code, I'm getting error:

pywintypes.error: (67, 'NetUseAdd', 'The network name cannot be found.')

This is my scenario:
Win2003 Server hosting DFS root #NTS-03
\\NTS-03.central.purdue.lcl\MI
Win2003 Server hosting file share
\\itifs03.itap.purdue.edu\itea_zonedirs\MI

<code>

import win32net

# this works --
win32net.NetUseAdd(None,1,{'remote':r'//itifs03.itap.purdue.edu/itea_zonedirs/MI/TEAMDIRS/DCS
Zone','local':'W:'})

# this doesn't work --
win32net.NetUseAdd(None,1,{'remote':r'//NTS-03.central.purdue.lcl/MI/TEAMDIRS/DCS
Zone','local':'W:'})

</code>

Any help greatly appreciated.

-Sean.

Nov 8 '07 #1
2 3325
On Nov 8, 2:23 pm, Sean Peterson <sean...@gmail.comwrote:
Has anyone had success using NetUseAdd() on shares that were replica links on a Windows 2003 DFS root? In my code, I'm getting error:

pywintypes.error: (67, 'NetUseAdd', 'The network name cannot be found.')

This is my scenario:

Win2003 Server hosting DFS root #NTS-03
\\NTS-03.central.purdue.lcl\MI

Win2003 Server hosting file share
\\itifs03.itap.purdue.edu\itea_zonedirs\MI

<code>

import win32net

# this works --
win32net.NetUseAdd(None,1,{'remote':r'//itifs03.itap.purdue.edu/itea_zonedirs/MI/TEAMDIRS/DCS
Zone','local':'W:'})

# this doesn't work --
win32net.NetUseAdd(None,1,{'remote':r'//NTS-03.central.purdue.lcl/MI/TEAMDIRS/DCS
Zone','local':'W:'})

</code>

Any help greatly appreciated.

-Sean.
We actually use win32wnet.WNetAddConnection2 to map a drive. The
following recipe lists a slightly different way of doing it as well:

http://aspn.activestate.com/ASPN/Coo.../Recipe/426742

I don't think you need to make those path strings into raw text if
you're using forward slashes, by the way.

Mike

Nov 8 '07 #2
On Nov 8, 2:23 pm, Sean Peterson <sean...@gmail.comwrote:
Has anyone had success using NetUseAdd() on shares that were replica links on a Windows 2003 DFS root? In my code, I'm getting error:

pywintypes.error: (67, 'NetUseAdd', 'The network name cannot be found.')

This is my scenario:

Win2003 Server hosting DFS root #NTS-03
\\NTS-03.central.purdue.lcl\MI

Win2003 Server hosting file share
\\itifs03.itap.purdue.edu\itea_zonedirs\MI

<code>

import win32net

# this works --
win32net.NetUseAdd(None,1,{'remote':r'//itifs03.itap.purdue.edu/itea_zonedirs/MI/TEAMDIRS/DCS
Zone','local':'W:'})

# this doesn't work --
win32net.NetUseAdd(None,1,{'remote':r'//NTS-03.central.purdue.lcl/MI/TEAMDIRS/DCS
Zone','local':'W:'})

</code>

Any help greatly appreciated.

-Sean.
I'm not seeing any typos in your code...but it looks like you're
trying to map two different locations to the same drive letter. Maybe
that's throwing an error in and of itself?

Nov 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Harlin | last post: by
8 posts views Thread by Earl Damron | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.