VBS — Example migrate homedrives in userproperties

Home Forums Scripting Windows Script Host VBS — Example migrate homedrives in userproperties

This topic contains 0 replies, has 1 voice, and was last updated by Avatar Dumber 15 years, 8 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    Dumber
    Participant
    #98118
    Code:
    ‘ AUTHOR: Marcel Henderik

    ‘ COMMENT: Change homedir path in the userproperties when you
    ‘manually copy the shares (with hyena for example) and data (with
    ‘robocopy for example)

    Set ObjOU= GetObject (”LDAP://OU=USerOU,DC=Test,DC=local”)

    objOU.filter=array(”user”)
    For Each ObjUser In ObjOU
    Home=ObjUser.HomeDirectory
    WScript.Echo home
    On Error Resume next
    If Left (UCase(home),12) = “\Server001″ then
    home =Replace (UCase (home) ,”\SERVER001”,”\Server2″)
    WScript.Echo home
    End If
    ObjUser.Put “HomeDirectory” , home
    ObjUser.SetInfo
    Next

    Set objOU = Nothing

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.