Check for running processes before deploying

3

Hi everyone,

i am fairly new to Deploy and Inventory and we bought Deploy and Inventory mainly to help us deploy software to our Remote Desktop Servers. Deploying software is working greate, using commands i am able to change user state to install and execute. Now i am wondering, is there an option to check with inventory or deploy if there are currently users connected to those servers or if they are currently using the software i want to update? I'm a little concernt about problems and corrupted installations while trying to update a software that is currently in use by users. Our users tend to stay logged on all night or work in the middle of night so there is never a real window where i can be sure that no one is logged on.

Greetings

Freddy

Cancel
login to comment
3

Oh nice! I've been using PowerShell myself:

$Processes = Get-Process
if ( $Processes.ProcessName -contains "chrome" ) {
    Write-Output "Process Found - stopping"
    Exit 22
} Else {
    Write-Output "Process Not Found"
    Exit 11
}

Stop Process if Found

Cancel
login to comment

4

To check if a process is running I use this code, in this case when javaw.exe is running the deployement stops

%WINDIR%\System32\tasklist /FI "IMAGENAME eq javaw.exe" | find /I /N "javaw.exe"

also change the Succes codes field to "1"

enter image description here

Cancel
login to comment

1

You ever tried to generealize this? I am currently trying to put this script in a package, instead copy and past this script and creating several different versions of it. One script with the process name as a variable, no problem, but how to set something like a package wide variable or passing variables to packages. I am currently using nexted packages to update our RDS Servers. Step1 change user state, Step 2 install/update .... It would be cool to put this like a preflightcheck in front of all other steps but without creating this script for every single nested package.

Cancel
login to comment

0

Looks interessting too, i will try this method too, since i am personal a fan of powershell.

Cancel
login to comment

0

Works great thank you !

Cancel
login to comment

Reply