We have the Cisco AnyConnect client on our workstations and need a vbs script I can run when they login thru that will map their homedrive.
We have the Cisco AnyConnect client on our workstations and need a vbs script I can run when they login thru that will map their homedrive. The users are in 6 different OU's and depending on that OU I need to do a net use to a certain server.
for example:
if the user is in the ...\dandinicampus\staff ou then net use dr-main\homedrive$\username.
if the user is in the ...\edison\staff ou then net use ed-main\homedrive$\username.
etc.
Cannot just use ou name, will need to go by dn since all the users containers have the same name "staff"
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Set WshShell = WScript.CreateObject("WScript.Shell")  vHomeFolder = WshShell.ExpandEnvironmentStrings("%HomeShare%") Set Network = CreateObject("Wscript.network") MsgBox(vHomeFolder) Network.MapNetworkDrive "H", vHomeFolder
Set WshShell = WScript.CreateObject("WScript.Shell")  vHomeFolder = WshShell.ExpandEnvironmentStrings("%HomeShare%") Set Network = CreateObject("Wscript.network") MsgBox(vHomeFolder) Network.MapNetworkDrive "H", vHomeFolder
Please log in to answer
Posted by:
dugullett
11 years ago
Can you use something like this along with GPOs applied to each OU?
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "H:" , "\\dr-main\homedrive$\username"
Comments:
-
I am also researching using objUser.homeDirectory, Been pulled off for a major problem so I will get back to this tomorrow. Gpo's seem useless thru the cisco vpn, it does not run the login processes normally. The server guys tell they can get a VB script to run or a bat file (maybe make powershell call via batch) post cisco login but it will not run normal domain login scripting. - SMal.tmcc 11 years ago
-
went with
Set WshShell = WScript.CreateObject("WScript.Shell") 
vHomeFolder = WshShell.ExpandEnvironmentStrings("%HomeShare%")
Set Network = CreateObject("Wscript.network")
MsgBox(vHomeFolder)
Network.MapNetworkDrive "H", vHomeFolder - SMal.tmcc 11 years ago