6 Replies Latest reply on Jun 15, 2011 9:57 AM by Adil Rathore

    Deploy Tuner via Active Directory GPO or LoginScripts

    Joe Packard
      Share This:

      So, I know it can and has been done.  I cannot find anything useful in the documentation or searching this forum.

       

      I have a customer who wants to unstall Tuners via GPO or LoginScripts.  Does anyone have a best practice guide?

       

      I would assume the script would need to encompass the following;

           verify there is no Tuner installed

                if there is a Tuner, can it be started?

                     Start the tuner

                If not started, remove it and re-install new tuner

           if no tuner exists, install new tuner

       

      Is there such a script already written? 

       

      I appreciate any feedback.

      Thx.

        • 1. Re: Deploy Tuner via Active Directory GPO or LoginScripts

          I have a script that checks for tuner service and old tuner installations removes them ensures that the installation directory s cleaned up and then nstalls the tuner... it can be used through GPO

          • 2. Re: Deploy Tuner via Active Directory GPO or LoginScripts

            Below is a sample GPO script which checks for the presence of the tuner service (bcac), runs the service if it is stopped and if the service is not present installs the tuner on the workstation.

             

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

             

            Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

            Set objShell = CreateObject("WScript.Shell")
                strCommand =  "sc query bcac"   
                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 bcac"

              
                Else
                'WScript.Echo "Installing Tuner..."
                strSourceFile = "\\test.com\SYSVOL\test.com\Policies\{3B589DE5-9679-4161-B20B-EA6504475676}\Machine\Scripts\Startup\*tuner.exe"
                strTargetFile = "C:\Temp"
                Set objFSO = CreateObject("Scripting.FileSystemObject")
                  booOverWrite = vbTrue
                  objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite
              'WScript.Echo "Installing Tuner..."
                objShell.run "c:\temp\win_BBCA_Tuner.exe"
               
                End If

             

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

            • 3. Re: Deploy Tuner via Active Directory GPO or LoginScripts
              Andres Alvarez

              Hi Adil,

               

              This Script work fine and is simple.

               

              I tested this in W2k3 AD Domain.

               

              Regards,

               

              Andres.

              • 4. Re: Deploy Tuner via Active Directory GPO or LoginScripts

                Did you mention the exact service name of the tuner within the strCommand variable, because you needed to modify this line in accordance with the tuner service running on your workstations.

                 

                strCommand =  "sc query bcac"   

                • 5. Re: Deploy Tuner via Active Directory GPO or LoginScripts
                  Andres Alvarez

                  His observation is correct.


                  Additionally I have modified other parameters also

                  Only one question. I don't view strResult section. What is the purpose of this?

                   

                  My script here:

                   

                  Dim objFSO, strSourceFile, strTargetFile, booOverWrite, strResult

                   

                  Set objShell = CreateObject("WScript.Shell")

                      strCommand =  "sc query EFTuner"  

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

                   

                   

                      Else

                      'WScript.Echo "Installing Tuner..."

                      strSourceFile = "\\10.10.61.235\bladelogic\EF_Tuner_stub.exe"

                      strTargetFile = "C:\Windows\Temp\"

                      Set objFSO = CreateObject("Scripting.FileSystemObject")

                        booOverWrite = vbTrue

                        objFSO.CopyFile strSourceFile, strTargetFile, booOverWrite

                    'WScript.Echo "Installing Tuner..."

                      objShell.run "c:\Windows\Temp\EF_Tuner_stub.exe"

                    

                      End If

                  ______________

                   

                  Regards,

                   

                  Andres.

                  • 6. Re: Deploy Tuner via Active Directory GPO or LoginScripts

                    Just a junk variable. You can delete it.