Link to home
Start Free TrialLog in
Avatar of Jean-Sebastien Picard
Jean-Sebastien PicardFlag for Canada

asked on

Windows Server 2008 VBS login script

Hi!

We have a VBS login script but I just want un specific user to map different drive.

Like if the username = "JSMITH" then goto then end of the script and run something else.

is it possible?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Dan Walker
Dan Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was going to suggest trying this... just add it into the middle of your login script and change the required values in <>

'start script

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

'find user name

strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
strUserName = objUser.CN

' if user then map network drive

Select Case strUserName
Case "<USERNAME>"
objNetwork.MapNetworkDrive "<DRIVE LETTER>:", "<NETWORK PATH>"

End Select
Next

'end script

Open in new window