/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


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.

07/25/2012 6982 views

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
0 Comments   [ + ] Show comments

Comments


All 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
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ