Deployed VS Scripts _never_ executes - HELP!

Discussion in 'Active Directory' started by it-support, Jul 12, 2007.

  1. it-support

    it-support Guest

    Hi,

    I have a bunch of .VBS files that I have deployed through Active Directory
    to run when a user log on a system. I have deployed applications and they
    work great. But the VBS? Never even runs, I dont even get as much as an error
    when I log on and they are supposed to kick in.

    Is it something Ive forgotten. Ive followed the routine to do this very
    carefully and tested my scripts, and they all work when executed locally on a
    machine when you I have logged in.

    The Scripts I want to run on user login:

    firewall - disable.vbs
    Set objFirewall = CreateObject("HNetCfg.FwMgr")
    Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
    objPolicy.FirewallEnabled = FALSE

    Security Center - disable firewall notify.vbs
    Const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set objRegistry = GetObject("winmgmts:\\" & strComputer &
    "\root\default:StdRegProv")
    strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center"
    strValueName = "FirewallDisableNotify"
    dwValue = 1
    objRegistry.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName,
    dwValue

    service - start messenger.vbs
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name='Messenger'")
    For Each objService in colServiceList
    errReturn = objService.StartService()
    Next
    Wscript.Sleep 20000
    Set colServiceList = objWMIService.ExecQuery("Associators of " _
    & "{Win32_Service.Name='Messenger'} Where " _
    & "AssocClass=Win32_DependentService " & "Role=Dependent" )
    For Each objService in colServiceList
    objService.StartService()
    Next

    As I wrote, these scripts are working when executed in a running XP session.
    Deployed through the Windows Server 2003 brilliant extra ordinary magic
    Active Directory it does not.

    I deploy it on the server by going into GE, in User Configuration ->
    Windows Settings -> Scripts (Logon/Logoff) -> Logon.

    And I add the script "firewall - disable.vbs" from:

    C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon

    I will be giving out weekend weekend astral journeys to Siberia for anyone
    who can crack this nut for me.
     
    it-support, Jul 12, 2007
    #1
    1. Advertisements

  2. Where does the script reside? Do the users have access to it when they are
    first logging on? This is a common error, best location is in the gpo
    itself.
     
    Paul Bergson [MVP-DS], Jul 12, 2007
    #2
    1. Advertisements

  3. I have an FAQ describing how to setup logon scripts linked here:

    http://www.rlmueller.net/LogonScriptFAQ.htm

    In particular, if you assign logon scripts on the Profile tab in ADUC, the
    VBScript should be placed in the NetLogon folder. If you use Group Policy,
    best is to paste the script file in the dialog, as described in the link.

    Also, if the script runs for a user logged in as Administrator, it may not
    work for normal users. Be sure to test while logged in as a normal user.

    --
    Richard Mueller
    Microsoft MVP Scripting and ADSI
    Hilltop Lab - http://www.rlmueller.net
     
    Richard Mueller [MVP], Jul 12, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.