1 2 Previous Next 17 Replies Latest reply: Jun 29, 2012 2:59 PM by Adil Rathore RSS

GPO Script to install BBCA Agent

subramaniv

Hi,

 

Can someone send me GPO script to install BBCA client agent on VPN machines using stub installer ?

 

Subramani

  • 2. GPO Script to install BBCA Agent
    subramaniv

    Thanks Adil. I will test the script.

  • 3. Re: GPO Script to install BBCA Agent
    subramaniv

    Hi Adil,

     

    I have executed the below script. But I recieve an error as attached saying "The system cannot find the file specified". would you please tell me why I am getting error.

    _______________________________________________________________________________________

    Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

    Set objShell = CreateObject("WScript.Shell")
        strCommand =  "sc query BBCAClient"   
        Set objExecObject = objShell.Exec(strCommand)   
        strText = objExecObject.StdOut.ReadAll()
       
        'WScript.Echo strText
       
        If Instr(strText, "RUNNING") > 0 Then   
        'WScript.Echo "Tuner is Running"
      
        ElseIf Instr(strText, "STOPPED") > 0 Then
        'WScript.Echo "Tuner is Stopped"

        objShell.run "sc start BBCAClient"

      
        Else
        'WScript.Echo "Installing Tuner..."
        strSourceFile = "C:\BBCAClientv5_stub.exe"
        strTargetFile = "C:\Temp"
        Set objFSO = CreateObject("Scripting.FileSystemObject")
          booOverWrite = vbTrue
          objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite
      'WScript.Echo "Installing Tuner..."
        objShell.run "C:\temp\BBCAClientv5_stub.exe"
       
        End If

    ________________________________________________________________________________________

     

    Subramani

  • 4. Re: GPO Script to install BBCA Agent
    Adil Rathore

    See the below value assignments in the script:

     

    strSourceFile = "C:\BBCAClientv5_stub.exe"

    strTargetFile = "C:\Temp"

     

    You are copying it to a temp folder which does not exist on the workstation.

     

    Either create the temp directory or set the strTargetFile to a folder that would be present on the workstation.

  • 5. Re: GPO Script to install BBCA Agent
    Adil Rathore

    One curious question though.

     

    Why are you copying the exe from the workstation itself. why not from a network path which would be available to all workstations?

  • 6. Re: GPO Script to install BBCA Agent
    subramaniv

    Thanks Adil...I have made necessary changes and script is working fine now. Also I have changed source path from local to network drive.

     

    strSourceFile = "\\workstation\C\BBCAClientv5_stub.exe"

    strTargetFile = "C:\windows\Temp"

     

    Appreciate your quick reply

     

     

    Subramani

  • 7. Re: GPO Script to install BBCA Agent
    subramaniv

    Hi Adil,

     

    GPO Script works fine with W7 machines. But when it comes to WinXp, script copied executable files to c:\windows\temp folder but it did not triggered installation. Have tried manually executing the script in winxp machines, scripr works fine installing BBCA. Did you come across such issue where GPO copied exe file but did not triggered BBCA installation ?

     

    -Subramani

  • 8. Re: GPO Script to install BBCA Agent
    Adil Rathore

    when this script was created it was tested more rigorously on win xp rather than win 7. So it should work with both the versions of Windows.

  • 9. Re: GPO Script to install BBCA Agent
    afernando@doitt.nyc.gov

    Im having the same issue as subramaniv. The script works for Windows 7 but doesnt install on XP. The file gets copied but doesnt execute on XP. Any ideas? My script is below.

     

    Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

    Set objShell = CreateObject("WScript.Shell")
        strCommand =  "sc query BbcaEndPoint"  
        Set objExecObject = objShell.Exec(strCommand)  
        strText = objExecObject.StdOut.ReadAll()
      
        'WScript.Echo strText
      
        If Instr(strText, "RUNNING") > 0 Then  
        'WScript.Echo "Tuner is Running"
     
        ElseIf Instr(strText, "STOPPED") > 0 Then
        'WScript.Echo "Tuner is Stopped"

        objShell.run "sc start BbcaEndPoint"

     
        Else
        'WScript.Echo "Installing Tuner..."
        strSourceFile = "\\fileshare\LogonScripts\bmc_bbca\BbcaEndPoint75.exe"
        strTargetFile = "C:\windows\"
        Set objFSO = CreateObject("Scripting.FileSystemObject")
          booOverWrite = vbTrue
          objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite
      'WScript.Echo "Installing Tuner..."
        objShell.run "C:\windows\BbcaEndPoint75.exe"
      
        End If

  • 10. Re: GPO Script to install BBCA Agent
    subramaniv

    Hi,

     

    I posted this issue in Microsoft technet forum and below is the response.

     

    The default computer startup script processing behavior for Windows XP Pro is asynchronous. That means computer startup scripts no longer wait for the pervious script to complete before starting the next startup script.

    You may enable Group Policy “Run logon scripts synchronously” to force the system to run the script synchronously, one after another.

    You can configure it at:

    Computer Configuration\Administrative Templates\System\Scripts

    For more information please refer to following MS articles:

    Scripts Extension Tools and Settings
    http://technet.microsoft.com/en-us/library/cc738773(v=WS.10).aspx
    Group Policy Script Processing Behavior
    http://blogs.technet.com/b/askds/archive/2010/03/23/group-policy-script-processing-behavior.aspx

    but I havn't tested it yet. any suggestion ???

     

    Subramani

     

  • 11. Re: GPO Script to install BBCA Agent
    afernando@doitt.nyc.gov

    Tried that. No luck.

  • 12. Re: GPO Script to install BBCA Agent
    Adil Rathore

    It seems that the copy operation is not confirming the file copy and lets control pass to the run method.  It is better you create a loop condition in the script which checks the presence of the file and its size and if both are correct  the loop ends and runs the installation.

  • 13. Re: GPO Script to install BBCA Agent
    subramaniv

    Hi Adil,

     

    Can I have modified script with loop conditions ? sorry I am not that good in scripting..

     

    Subramani

  • 14. Re: GPO Script to install BBCA Agent
    Adil Rathore

    Changes inline:

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------

     

    Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

    Set objShell = CreateObject("WScript.Shell")
    strCommand = "sc query BBCAClient"
    Set objExecObject = objShell.Exec(strCommand)
    strText = objExecObject.StdOut.ReadAll()

     

    'WScript.Echo strText

     

    If Instr(strText, "RUNNING") > 0 Then
    'WScript.Echo "Tuner is Running"

     

    ElseIf Instr(strText, "STOPPED") > 0 Then
    'WScript.Echo "Tuner is Stopped"

    objShell.run "sc start BBCAClient"


    Else
    'WScript.Echo "Installing Tuner..."
    strSourceFile = "C:\BBCAClientv5_stub.exe"
    strTargetFile = "C:\Temp"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    booOverWrite = vbTrue
    objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite

     

     

    Do

       If objFSO.FileExists("C:\BBCAClientv5_stub.exe") Then

    Exit Do

       Else

          WScript.Sleep 1000

       End If

    Loop

     

    'WScript.Echo "Installing Tuner..."
    objShell.run "C:\temp\BBCAClientv5_stub.exe"

     

    End If

1 2 Previous Next