Set profile and homefolder path at logon?

Discussion in 'Scripting' started by TK, May 31, 2004.

  1. TK

    TK Guest

    I am looking for some fault tolerance help and I am wondering if I can set
    the user's profile path (we are using roaming profiles) and the home folder
    path during a logon script? Is it too late by the time it would execute the
    If not - here is what I need:
    A script which first checks to see if the main server is available - if so
    we set the profile path and home folder path to the proper folders on that
    server. If not, then we set the profile path and home folder path to the
    proper folder locations on the secondary domain control/server. I think I
    know how to set the paths alright, what I don't know how to do is check for
    the availability of the computer first.
    Also, if this is part of the GPO for the entire domain - how much is this
    going to slow down the logon process? Is there a better way to do what I am
    trying to do?
    Lastly, I need a script which will copy the folders - profiles and home
    folders - over to the secondary dc/server each night, but without changing
    the ownership. Our security is set up to give full permissions only to the
    creator owner and if the copy process changes the owner to Administrator,
    the user will not have access to their own files.
    Thanks in advance for any and all help.
    TK, May 31, 2004
    1. Advertisements

  2. TK

    Stephen Guest

    Checking to see if the server is available is one method, but if both
    servers that could be home to the profiles are domain controllers, there is
    an easy way. Domain Controllers will load balance the logon, and set an
    environement variable on each user's workstation. So if one DC is down, then
    all users logons will be processed by the other DC. Here is a sample to get
    the logon server variable:

    Set oShell = WScript.CreateObject("WScript.Shell")
    Set oProcessEnvironment = oShell.Environment("Process")
    sPSrv1 = UCase(oProcessEnvironment("LogonServer") & "\")

    I use the above to provide a fault tollerant printing environment. Let me
    know if you want to see more of the script.

    Still, a better way to do this is to use the features already built into
    Windows for this - DFS with FRS replication. Do some research.

    Finally, xcopy and robocopy will maintain ntfs permissions with the right
    parameters. You could run them from a script or batch file...

    Stephen, Jun 1, 2004
    1. Advertisements

  3. TK

    TK Guest

    Thanks for your response. You are correct about one DC kicking in if the
    other fails, but the one caveat I don't think that covers is roaming
    profiles - or does it. The profile folders are stored on server1.
    In each user's profile we have the profile path set to that server and their
    profile folder. The same with the home folder - set to server1\username.
    What I was planning on doing was to set up a script which would copy those
    files each night to server2. Then, have a logon script which re-sets the
    profile path and home folder path to their folders on server2 if server1 is
    not available. I would leave the user accounts as is - profile set to
    server1 - and only change them by script if the server1 was down.
    Is that making sense? Is that not a good way to do it? If Windows Server
    2003 has a better fault tolerance method to accomplish what I am trying to
    do, I have not found it in any admin books I have bought or in the built in
    help. If you know of built in methods, or anything better than my plan -
    believe me, I am open and willing. As I stated, I am learning as I go, so
    any and all help is appreciated.
    Thanks in advance.
    TK, Jun 2, 2004
  4. TK

    Stephen Guest

    Well, I think you could do this with DFS replication - and it would be a
    cleaner better way. The difference would be that with DFS replication,
    user's profiles would stay live on both servers in near real time, and DFS
    would randomly point the user to one server's copy of the profile, or the
    other, upon logon. So, you wouldn't need to do the nightly copy, and you
    would get load balancing between the file servers. However, you may only
    want user's to access the second server in an emergency perhaps because of
    performance or licenseing issues on the second server? Also, there is a
    learning curve with DFS/FRS..Take a look here to see if DFS looks good for
    you -

    Else, there are many ways to determine if a server is up or down, though it
    seems like it might be resource intensive to have to do this for every
    logon. If you've standardized on XP, then there is this: ,
    or you could use one of the many others that gather info from a computer.
    You could even create a share on the main file server and have the logon
    script check for its presence.

    Good Luck,

    Stephen, Jun 2, 2004
  5. TK

    TK Guest

    Thanks a million for waking me up to this (Dfs and Frs). It is exactly what
    I need and will accomplish my goals without the hoggish use of logon files -
    at least I think it will. Thanks for the link and I will continue to
    research this out until I get it working in our environment.
    TK ,
    TK, Jun 4, 2004
  6. TK

    Stephen Guest

    Glad to help. I'd suggest that you start following the group, and apply the pre-service
    pack 1 patch if running Windows 2003, or other patche(s) if running 2000.
    DFS/FRS seems to do a lot of complex stuff behind the scenes, thus isn't as
    robust as I would hope and needs monitoring.

    StephenB ,
    Stephen, Jun 5, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.