Page 1 of 1

Automatically uninstall software when changing OUs with WAPT

Published: July 24, 2023 - 2:35 PM
by Baki
Hello everyone,

I need some information regarding a configuration I want to set up with WAPT.

Here's an example to better explain:

I have two PCs:
"PC_RH" in the OU "OU_RH"
and "PC_ACCUEIL" in the OU "OU_ACCUEIL".

For "OU_RH", I created a unit package that installs 7-Zip and VLC.
For "OU_ACCUEIL", I created a unit package that installs Firefox and VS Code.

Thanks to these unit packages, the software installs automatically on both PCs.

Now, let's imagine I swap the two PCs in the OU: the "Accueil" PC ends up in "OU_RH" and the "RH" PC in "OU_ACCUEIL".

This will then install the remaining software on the PCs, so they will end up with a total of four programs: 7-Zip, VLC, Firefox, and VS Code.
My question is: is there a way to automatically uninstall the software that was required in the old OU?

The "OU=...." package is indeed deleted and replaced by the new one, but the software it contained remains installed.

Thank you in advance for your advice and help. :D

WAPT version: 2.3
Server OS: Windows Server 2019
Administration machine OS: Windows 10

Re: Automatically uninstalling software when changing OUs with WAPT

Published: July 24, 2023 - 4:46 PM
by dcardon
Hi Antoine,

WAPT works on the principle of "the packages I need must be installed" (at a minimum).

So if there are more, it's not a problem for the WAPT agent. In fact, it's possible to install packages manually via the command line with `wapt-get install`, or through self-service, or through a dependency on another package (or group of packages).

Therefore, to perform this type of cleanup, you would need to check the origin of the installation and verify that the package wasn't installed as a dependency on the OU to allow for a Debian-style "autoremove". We already have an internal ticket for this, but it's not planned for a future release.

Alternatively, you could create a package that forces the uninstallation of packages that aren't inherited from the OU if needed.

Best regards,

Denis