Re: Running Login Script after establishing a VPN connection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



What calls up your VB Script program? Do you have any
control over it? If so, turn it into a pure batch command!
"\\domainx.com\netlogon.bat"
This would be equivalent to your current VB Script program
but much simpler. It also avoids the timing issue.

"TJCooper1972" <TJCooper1972@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:16F34B30-4713-4D6C-8B08-CDA686D54845@xxxxxxxxxxxxxxxx
We are using kixart in our login process. I cant really modify for the
login.bat file, because it would cause issues with people logging in
normally.

I suppose I could call up the text file with the actuall mapped drives and
parse it for UNC paths. Put those UNC paths into an array and then map
them.

"Pegasus (MVP)" wrote:

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")






.



Relevant Pages

  • Re: ScreenSaverGracePeriod
    ... Because the regkey correspondents to HK LOCAL MACHINE run it as a startup script not as a logon script. ... The user will have no rights to modify the registry. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... I created a bat file and a registry file and and set it all up ...
    (microsoft.public.windows.server.active_directory)
  • Re: Mapped Drives and Home Folders
    ... In Active Directory Users and Computers, ... On the Logon script line, ... name of the .bat file - do not include a path. ... Put it a shared folder with read only access. ...
    (microsoft.public.windows.server.general)
  • RE: Running Login Script after establishing a VPN connection
    ... Well, I moved on and decided to map a network drive, run the bat file, then ... The network drive disconnects before the bat file finishes ... and runs the login script specified. ... Set WshShell = CreateObject ...
    (microsoft.public.windows.server.scripting)
  • Re: ScreenSaverGracePeriod
    ... I set that in our default domain policy. ... appling that registry entry everytime the computer boots. ... script not as a logon script. ... I created a bat file and a registry file and and set it all up ...
    (microsoft.public.windows.server.active_directory)
  • Re: Scripts in Vista
    ... that can be tricky using cmd /c etc. ... and put that sort of line in the bat file. ... Monitor your enterprise Web Servers. ... I have tried to no avail to convert this to a script. ...
    (microsoft.public.windows.server.scripting)