12 Replies Latest reply on Jul 12, 2011 9:29 AM by SysAdmin12

    VBS deployment using LANDesk 9.0 SP2

    Rookie

      Hello,

       

      Can someone show me the proper way to deploy a VBScript using LANDesk?  I tried to deploy it as a batch file and also through WSH.  Neither works.

       

      I do it through a Push | Run from Source.

       

      Please advise.  Thank you.

        • 1. Re: VBS deployment using LANDesk 9.0 SP2
          Rookie

          I would like for this VBScript to run on the local machine.  What it does is prompt a user to restart their machine.

          • 2. Re: VBS deployment using LANDesk 9.0 SP2
            Apprentice

            If you packaged it with the Windows Script Host package type then you should only need to go to the 'Accounts' option inside of the package. In this section you can select either 'LocalSystem', which is the default option, or 'Current user'. In order for the user to see what your script is doing it needs to be run inside of their user context. Running packages inside the system context will not show an visuals for either scripts or installers. Additionally, when you select the user's context they'll need to have the appropriate rights.

             

            --hope that helps

            • 3. Re: VBS deployment using LANDesk 9.0 SP2
              Rookie

              Thanks for the reply!  I tried that.  Here are the exact steps that I take:

               

              1. I go to Distribution Packages
              2. New Distribution Package -> New Windows Script Host package
              3. I give the package a Name and a Description
              4. Under the primary file I add the full path (\\server.domain\share\something.vbs)
              5. I leave everything else default
              6. I Schedule the task. 
              7. Drag and drop the machines that I want to deploy this .vbs file to.
              8. I change the Delivery Method.  Delivery type = Push, Delivery Method = Run from Source

               

              This time I got a failed with the Result of an unspecified error.  Return code 16389.

               

              Please advise.

               

              Samson

              • 4. Re: VBS deployment using LANDesk 9.0 SP2
                Rookie

                Would appreciate an answer from LANDesk about this.

                 

                I have been trying to get an efficent way to push shortcuts to desktops since regular 9.0 LANDesk.

                 

                I have a vbscript programmed and running correctly locally, but when I schedule a distribution package push through LANDesk, I get "The action completed successfully" but no shortcut appears on the machine.

                 

                My current agent configuration does not include launchpad link manager (also defeats the purpose as you have to launch it to launch a link pushed through it) since I'm trying to push to end-users desktops.

                 

                Can anyone help out with this?

                • 5. Re: VBS deployment using LANDesk 9.0 SP2
                  Catalysttgj Expert

                  You might want to post your vbs code so that folks can have a look. It might be a "reach out to the world" permission problem, if any of these vb scripts are touching other files/folders on servers or what not.

                  • 6. Re: VBS deployment using LANDesk 9.0 SP2
                    EMiranda Expert

                    SysAdmin12 wrote:

                     

                    Would appreciate an answer from LANDesk about this.

                     

                    I have been trying to get an efficent way to push shortcuts to desktops since regular 9.0 LANDesk.

                     

                    I have a vbscript programmed and running correctly locally, but when I schedule a distribution package push through LANDesk, I get "The action completed successfully" but no shortcut appears on the machine.

                     

                    My current agent configuration does not include launchpad link manager (also defeats the purpose as you have to launch it to launch a link pushed through it) since I'm trying to push to end-users desktops.

                     

                    Can anyone help out with this?

                    Having a desktop icon appear really depends on the script your using and the package your installing.  I know some packages when you install the application manually they ask "For all users or just me" and depending on that setting is if you get a desktop shortcut, since you are deploying the software in Local System a package that only creates a desktop shortcut for the current user would try to install the shortcut in Local System, so you would not see that on other users profiles.

                     

                    A workaround is install the package on the test machine, copy the shortcut it creates and include in your LANDesk distribution package in the included files section , then in your vbscript copy that file to where it needs to go IE " ALL USES DESKTOP" after the package has run.

                    • 7. Re: VBS deployment using LANDesk 9.0 SP2
                      cknott SupportEmployee

                      I would change the delivery method to download from source so that its running the script from its local sdmcache folder.  That usually works better, and you dont have to worry about permissions.

                      • 8. Re: VBS deployment using LANDesk 9.0 SP2
                        Rookie

                        Thanks for the quick reply everyone!

                         

                        My apologies, I was a bit flustered on saturday as we moved to our new network, so it skipped my mind to post the code. Thank you for all the suggestions aswell, I'll give these a try.

                         

                        If anyone is familiar with VBScript, I may have also made an error in my code, but it seems to work and do what I need by just running it:

                         

                         

                        Set WshShell = CreateObject("WScript.Shell")
                        strDesktopPath = WshShell.SpecialFolders("Desktop")
                        Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\GfK Servers.lnk")
                        objShortcutUrl.TargetPath = "\\*****\Programs\Office"
                        objShortcutUrl.IconLocation = "\\*****\ldlogon\icons\Black-External.ico"
                        objShortcutUrl.Save 
                        
                        • 9. Re: VBS deployment using LANDesk 9.0 SP2
                          Rookie

                          No longer getting success with this. Out of nowhere LANDesk changed to "Unspecified Error"  16389

                           

                          Now, I know this is related to permissions, but I know for a fact that these machines are able to access the shares. Local System accounts may not, but even when I use current user account I still procede to get the 16389 error. I'm begnning to wonder if this is possibly a bug with LANDesk right now. I was on the phone with tech support for about 5 hours today and we still couldnt seem to get the shortcut pushed to the desktop.

                           

                          On one hand I feel like this is a very minimal task to be performing, and on the other I feel like it's something stupid on my end that I haven't checked off.

                           

                          I would greatly appreciate any more suggestions, as most of the VBScript topics seem to be unresolved when I did a search for them earlier. I'll try anything at this point ( I even tried to create an MSI package to install the shortcut).

                           

                          Thanks

                          • 10. Re: VBS deployment using LANDesk 9.0 SP2
                            Specialist

                            Just off the bat... the first thing I know is that the VB Script will run as the local system account.  Now because it's running as the local system account it doesn't know what the "Dekstop" is.  A simple test is to change the location of your shortcut.

                             

                            Set WshShell = CreateObject("WScript.Shell")
                            'strDesktopPath = WshShell.SpecialFolders("Desktop")
                            Set objShortcutUrl = WshShell.CreateShortcut("C:\GfK Servers.lnk")
                            objShortcutUrl.TargetPath = "\\file-server\share"
                            objShortcutUrl.IconLocation = "\\file-server\share\icon.ico"
                            objShortcutUrl.Save

                             

                            This script should create the shortcut on your C Drive now.

                             

                            That should point you in the right direction...

                             

                            If you give me a little bit of time, I can probably get it to work for you, otherwise, you may want to see what Environmental Variables / Windows Variables the SYSTEM account knows...

                             

                            %systemroot% = C:\Windows

                            %windir% = C:\Windows

                            %allusersprofile% = C:\ProgramData

                             

                            etc.

                             

                            And see if you can insert that in to the VB Script somewhere.

                            • 11. Re: VBS deployment using LANDesk 9.0 SP2
                              Specialist

                              OK... I tested this using a Push method, and it created the shortcut.

                               

                              Set WshShell = WScript.CreateObject("WScript.Shell" )
                              strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
                              Set oShellLink = WshShell.CreateShortcut(strDesktop & "\GfK Servers.lnk" )
                              oShellLink.TargetPath = "\\file-server\share"
                              oShellLink.IconLocation = "\\file-server\share\icon.ico"
                              oShellLink.Save

                              • 12. Re: VBS deployment using LANDesk 9.0 SP2
                                Rookie

                                Thanks for the reply,

                                 

                                The issue appeared to be the Active Directory groups, we have our own custom groups that we created, so we probably had permission errors somewhere. If you add the group "Domain Computers" to the share that the script is pointing to, then there was no longer any issues and it executed perfectly.

                                 

                                Thanks again for the help everyone.