4 Replies Latest reply on Oct 27, 2016 10:02 AM by phoffmann

    Install Software only when no user is logged in

    iku Rookie

      Hello,

      is it possible to setup distribution agent settings so that distribution starts only when there is no user logged in? Landesk 9.6SP3.

       

      Best Regards

      Ivan

        • 1. Re: Install Software only when no user is logged in
          BD_RB Apprentice

          Probably not the answer you are looking for but I know you can do this in v10

          • 2. Re: Install Software only when no user is logged in
            phoffmann SupportEmployee

            You *COULD* script something together - as either a wrapper, or a custom vulnerability in Vulscan - that'd check for "no user to be logged on" and - if so - launch your package installer.

             

            Vulscan is generally pretty maleable in that regard and awesomely abusable for all sorts of weird scenarios / requests like this one. But does involve you scripting something up a pre-req detection up (I suspect a powershell script might be able to do this reasonably easily).

             

            Why the requirement for "no user logged on" - you can usually just schedule out of hours for desktops, no? Bit of context does usually help .

            • 3. Re: Install Software only when no user is logged in
              iku Rookie

              We migrate from Office 2007 to Office 2016. When there is anybody logged in, migration needs a restart. Reinstallation is planned during the night but sometimes user forgets to log off.

              I solved it with a powershell script. I used bundled package, where the first package is Powershell script, which checks if there is anybody logged in.

               

              This is the script, if anybody is interested in:

               

              <#

              .SYNOPSIS

                The script waits in a loop until there is no user logged in.

              .DESCRIPTION

                Use it as a first package in a package bundle in landesk. Turn on 64bit environment for package

              #>

               

              # how often to check in seconds

              $interval = 60

              # -----

              $count = 1

              $loop = 0

              $query=$env:windir + "\system32\query.exe"

              $exe=$env:LDMS_LOCAL_DIR + "\..\sendtaskstatus.exe"

              $core=$env:CORESERVER

              $task=$env:TASK_ID

               

              while ((& "$query" user | measure-object).count -gt 1) {

                $minutes =  [math]::Round($loop * $interval / 60)

                & "$exe" "-core=$core" "-taskid=$task" "-retcode=0" "`"-message=waiting $minutes minutes`""

                start-sleep -s $interval

                $loop = $loop + 1

              }

               

              & "$exe" "-core=$core" "-taskid=$task" "-retcode=0" "`"-message= `""

              exit 0

              • 4. Re: Install Software only when no user is logged in
                phoffmann SupportEmployee

                Awesome - thanks for sharing.


                As an aside - the following MAY come in useful to you if you want to have more / different messaging as a "hack"-y option:

                - About SDCLIENT based communications

                 

                Hope that helps you along a bit as well .