views:

66

answers:

2

I have a primary and a backup windows 2008 server, and a bunch of windows XP clients that map a drive to a share on the primary server. If the primary server goes down, I want those client machines to automatically re-map their drive to the backup server, so they can continue to access the files.

Should I try to write a vbscript or python script or something that detects if the primary server is down and issues the appropriate "net use m: \server\share ..." but I need that script to run every minute, no matter who is logged in. Can I do that with windows "scheduled tasks" ?

I'm a Unix guy, and could use any tips you have to offer on accomplishing this. Is there a better solution?

many thanks, -Ian

+1  A: 

You could use DFS and have clients map to that for their share. Then they'd be redirected to one server or the other. This assumes that your DFS server stays up, of course.

Mark Allen
Thanks, I had looked into that. My challenge is that if one server fails, I want the other to take over... so I don't think I can use the DFS option because I don't have a third server. Also in case it comes to mind... I can't use a dns/wins failover because my university doesn't allow it... and I can't use an IP failover because our network is routed into segments, and the two machines are on different IP subnets.
Ian Charnas
A: 

That sounds like you need a client side solution then, unfortunately. Something along the lines of the following, in a .cmd file in each machine's startup folder or otherwise placed so that upon failure to connect, this file is executed:

if not exist \\server1\sharename goto mapsecondserver 
net use z: \\server1\sharename 
goto end 

:mapsecondserver 
net use z: \\server2\sharename 
goto end 

:end
Mark Allen
Cool, that's the kind of thing I was looking for. I'll need to add some additional code but I can continue myself in this direction. Thanks much mark!!!
Ian Charnas