Re: Running Login Script after establishing a VPN connection
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 9 May 2008 22:40:03 +0200
Put the "net use z: /d" into "login.bat".
You could simplify things considerably if you used UNC coding
for your logon script. In this case you would not need to map
or unmap a share to drive Z:.
"TJCooper1972" <TJCooper1972@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9A16E390-ED5C-45CD-8AE5-6FAAC9C3DF54@xxxxxxxxxxxxxxxx
Well, I moved on and decided to map a network drive, run the bat file,
then
disconnect the network drive.
Only one problem. The network drive disconnects before the bat file
finishes
running.
What is the most gracefull way to fix this new issue (create a timer?)?
Set objNetwork = Wscript.CreateObject("Wscript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & ADSysInfo.UserName &"")
Set WshShell = WScript.CreateObject("WScript.Shell")
Wscript.echo "z:\"& objUser.ScriptPath
objNetwork.MapNetworkDrive "z:", "\\domainx.com\netlogon"
wshshell.run "z:\folder\login.bat"
objNetwork.RemoveNetworkDrive "z:"
---------------
"TJCooper1972" wrote:
I want to create a script the user can run that pulls his
objuser.scriptpath
properties, and runs the login script specified.
Is there a way to simply restart the login process (the part that goes to
that location and runs the specified script)?
So far I have a script that get the correct field, but I dont know how to
run/launch a bat file using that information. Ive tried wscript.run and
wsshell.run, but they dont seem to work. Any suggestions?
Set oNet = Wscript.CreateObject("Wscript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & ADSysInfo.UserName &"")
Set WshShell = CreateObject("Scripting.FileSystemObject")
Wscript.echo "Script Path: \\domain.loc\netlogon\ou\"& objUser.ScriptPath
'wscript.run "\\domain.loc\netlogon\ou\"& objUser.ScriptPath
'wshshell.run "\\domain.loc\netlogon\ou\"& objUser.ScriptPath
Set oNet = Wscript.CreateObject("Wscript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & ADSysInfo.UserName &"")
Set WshShell = CreateObject("Scripting.FileSystemObject")
.
- Follow-Ups:
- Re: Running Login Script after establishing a VPN connection
- From: TJCooper1972
- Re: Running Login Script after establishing a VPN connection
- From: TJCooper1972
- Re: Running Login Script after establishing a VPN connection
- References:
- Running Login Script after establishing a VPN connection
- From: TJCooper1972
- RE: Running Login Script after establishing a VPN connection
- From: TJCooper1972
- Running Login Script after establishing a VPN connection
- Prev by Date: Re: Multiple AD Users / Group Memberships / Comparison
- Next by Date: Re: Running Login Script after establishing a VPN connection
- Previous by thread: RE: Running Login Script after establishing a VPN connection
- Next by thread: Re: Running Login Script after establishing a VPN connection
- Index(es):
Relevant Pages
|
Loading