Set home users home folder in VBS or GPO
As my subject line says itself, I am searching a way to set my entire users Home Folder in either in VBS or in GPO. The way I knew was using the he profiles tab in Active Directory 2003 but there are many articles on web that says we don’t need to do the same. But the problem is there is no other way mentioned using which I can do what I want to do.
Can anyone here knows about any alternate way for the same? If yes, please let me know soon.
Many Thanks.
Re: Set home users home folder in VBS or GPO
You dint mentioned which server you are using. I guess its Windows Server 2003, right? You will need to wait until you have Windows Server 2008 in order to use built-in ability to map drives via GPO's because this functionality is included as part of Group Policy Preferences in Server 2008.
Alternatively you can also create a user drive mappings via logon scripts - which you can configure from GPO. See if it helps.
Re: Set home users home folder in VBS or GPO
Thank you very much for the help and for a great news that Server 2008 comes with this builtin But still the problem am facing is though i'm able to map my users "home folder" in a vbs script without any problem i'm failing while setting up the HomeDir and HomePath so that when a user saves a file it goes straight to the users home folder. Somebody told me that i can use dos command set and see them but i wanted to know how can i set them in VB if that is what I should be doing? Please help.
Re: Set home users home folder in VBS or GPO
This will probably help you out.
Quote:
On Error Resume Next
Set objUser = GetObject("LDAP://cn=Ken Myer, ou=Finance, dc=fabrikam, dc=com")
If IsEmpty(objUser.homeDirectory) or IsNull(objUser.homeDirectory) Then
strUser = objUser.sAMAccountName
strHomeDirectory = "\\atl-dc-01\users\" & strUser
objUser.homeDirectory = strHomeDirectory
objUser.homeDrive = "Z:"
objUser.SetInfo
End If
For more help, check this Microsoft Article: How Can I Assign a New Home Drive to a User Who Doesn’t Have One?
Re: Set home users home folder in VBS or GPO
Help appreciated Milton but I don’t think it is going to help me because it appears to update the AD objects for the normal user which doesn't have access to? Anyways, can you just provide me a very similar method using which I can update it on just users local environment?
Re: Set home users home folder in VBS or GPO
Hello Umedd, Just try incorporating the following into your login script:
Set oShell = CreateObject("WScript.Shell")
Set oEnvVol = oShell.Environment("Volatile")
Set oEnvProc = oShell.Environment("Process")
Set oNet = CreateObject("Wscript.Network")
oEnvVol("HomePath") = "\"
oEnvVol("HomeDrive") = "H:"
oEnvVol("HomeShare") = "\\YourServer\Home\" & oEnvProc("UserName")
oNet.MapNetworkDrive oEnvVol("HomeDrive"), oEnvVol("HomeShare")