Discussion Locked

Home dir script

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to write a script that will remap a users home folder. For example I have users home folders on server1. In Active dir the path in their users profile is H:\server1\users\username.

Those files are replicated to server2 for disaster recovery. If server1 blows we need a script that will redirect users home folder and profile path from server1 which is where Active Directory will try and send them to server2.

8 replies

by cg it

why not make server to a DC. AD will be replicated to it and so will DNS [allow updates]. so if server 1 does down there will be a backup DC [server 2] for clients to get DNS and AD from. The profiles will also be available on server 2 [AD replication].

by california dead head

That will not solve the issue. The profiles will be available on server2. I have 2 DC's already. The issue is that at login AD will look to server1 for the profile info because that is what is currently in there. If server1 is down the profiles are still available on server2 but AD doesn't know that. I would have to go into each users (370) AD account and repath the home folder to server2 manually.

by cptomlly

Use a Domain DFS root to mirror the data via a single reference. This will allow you to use a "virtual" reference to files located on multiple servers. These references will also be replicated with AD replication. This will allow you to have a share \\users\profiles that may be stored on \\server1\profiles or \\server2\profiles or any other server. See this MS article for more details: http://tinyurl.com/gqox

Hope this helps

by bristar

How about something to this effect:
Dim fso, WshNetwork
Set fso = CreateObject _
("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject _
("WScript.Network")
If (fso.FolderExists(\\Svr1\Public)) Then
WshNetwork.MapNetworkDrive "E:", "\\Svr1\Public"
Else
WshNetwork.MapNetworkDrive "E:", "\\Svr2\Public"
End If

This discussion is closed to new replies.