Hi, I'm having problems with a login script on a W2k3 Server. I would like a simple login script to set a new user with correct profile and homedrive setup when the new user logs on.
I managed to gather some info and combined it into this script:
ON ERROR RESUME NEXT
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
'Automatically find the domain name
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")
'Find the Windows Directory
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
'Grab the user name
UserString = WSHNetwork.UserName
strUser = objUser.userstring
strHomeDirectory = "\\ADD001\home\" & struser
objUser.homeDirectory = strHomeDirectory
objUser.homeDrive = "H:"
objUser.SetInfo
Unfortunatley this doesn't do the trick..
I am still a rookie concering vbscripting, so I'd appreciate some help in here.
I managed to gather some info and combined it into this script:
ON ERROR RESUME NEXT
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
'Automatically find the domain name
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")
'Find the Windows Directory
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
'Grab the user name
UserString = WSHNetwork.UserName
strUser = objUser.userstring
strHomeDirectory = "\\ADD001\home\" & struser
objUser.homeDirectory = strHomeDirectory
objUser.homeDrive = "H:"
objUser.SetInfo
Unfortunatley this doesn't do the trick..
I am still a rookie concering vbscripting, so I'd appreciate some help in here.