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"

 

Answer Summary:
Set WshShell = WScript.CreateObject("WScript.Shell")  vHomeFolder = WshShell.ExpandEnvironmentStrings("%HomeShare%") Set Network = CreateObject("Wscript.network") MsgBox(vHomeFolder) Network.MapNetworkDrive "H", vHomeFolder
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

2

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"
 
Answered 07/25/2012 by: dugullett
Red Belt

  • 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.
  • went with
    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 comment
Answer this question or Comment on this question for clarity