Hi, thanks for a great tool! I could not find information about the topic
I know how Activesetup works, how does the command Execute-MSI -Action ‘ActiveSetup’ -Path '… work?
Hi, thanks for a great tool! I could not find information about the topic
I know how Activesetup works, how does the command Execute-MSI -Action ‘ActiveSetup’ -Path '… work?
I’ve never noticed this parameter until today. There is no example in the docs or the code comments.
Use Set-ActiveSetup
instead.
What do to want to trigger with ActiveSetup?
I hope it’s not MSI. It’s dog slow for ActiveSetup.
Thanks for your reply!
The purpose is that all users that login needs to install a user based install .msi that we use.
Yes, i tested the Set-ActiveSetup it’s working good.
It would be nice to understand the command Execute-MSI -Action ‘ActiveSetup’ -Path '…
I cant figure the command out but it would be nice to know
According to the code it will launch the MSI with the following MSIEXEC switches: /fups (see msiexec | Microsoft Docs)
It will also create a log file ending with _ActiveSetup.log
My best guess is:
Execute-MSI -Action 'ActiveSetup' -Path 'Install_Me_per_user.msi'
Since $Action
is not mentioned in a way that would trigger Set-ActiveSetup
from Execute-MSI
, my best guess is that it tries to FIX Shortcuts, Files and registry entries for the user running PSADT. I think it’s meant to be used BY Set-ActiveSetup
. This however would not work since PSADT no longer works for non-admins. The functionality was broken in the last year or so. ( see Use PSAppDeployToolkit without local administrator - #8 by RaghuKeenLearner)
.
If that is the case, try something like this instead:
[String]$LocalPathToYourMSI = "<some place on the computer that the user can READ>"
Copy-file -Path 'Install_Me_per_user.msi' -Destination $LocalPathToYourMSI -ContinueOnError $false
Set-ActiveSetup -StubExePath "$envSystem32Directory\msiexec.exe" -Arguments "/i `"$LocalPathToYourMSI`" /QN /L*v "%temp%\Install_Me_per_user_MSI_Install.log" " -ContinueOnError $false
Thanks for the help!
Yes, i could see the /fups in AppDeployToolkitMain.ps1 but thats as you answered a repair of something already installed… looking forward when the next version is released. Do you know when the next version is released Q2-2022?
The Set-ActiveSetup is the way i do it today or similar.
I was looking for some more advanced install / cleanup more like …
Execute-ProcessAsUser -Path “$envSystem32Directory\msiexec.exe” -Parameters "/x `"C:\ …
In the best of worlds i would like the possibility to cleanup cashed userprofiles / load cashed userhives to uninstall userbased installs. How do you solve that?
I hope im not out of scope, please tell me if i should open a new tread.
When I do an Active-Setup I do it as one of the last things.
And for uninstalls, I do the clean up of Active-Setup as one of the first things using this:
Set-ActiveSetup -Key $installName -PurgeActiveSetupKey
The -PurgeActiveSetupKey
parameter does EXACTLY what you described.
It loads each HKCU to remove the Reg Key.
Sry, i was unclear.
I use the -PurgeActiveSetupKey today and its working to cleanup the ActiveSetup, but the userbased installs does not cleanup.
If you have shared computers with lots of userprofiles and some of them has userbased installs how do you cleanup the profiles without all users having to login to activate an activesetup stubpath that i made for cleanupjobs?
I’ve been lucky that we only have one POS user-based install apps (Ms Teams) and it’s the other packager guy’s problem.
PSADT does have Execute-ProcessAsUser
but the targeted user must be already logged-in.
Sadly, the only ways I could see you being able to clean-up User-based installs is
-with Active-Setup when users logon (easy but some users profiles will never be cleaned out)
-With a combination of Invoke-HKCURegistrySettingsForAllUsers
+ cleaning files out of User profiles (Trial and error)
Good luck and try to stay away from user-based installs.
You are confusing things. If it’s an user based install, then you don’t need active setup.
You don’t need to remove the registries from the HKCU hive. They are created as a flag so windows installer knows that active setup has run on that user.
If you have an idea on how to uninstall user-based installs (aka apps installed by the user into their profiles), Please share.
In SCCM, you need to select “Install for user” in the deployment type. And in the uninstall command, if you create logs, just make sure the user has access to the log path. The rest is the same and per system apps.
Hi Adipiciu, sry i don’t follow. Im open to whatever solution, im new to the deployment area and don’t know better solutions to my user install problem today.
In psadt i have the Remove-MSIApplications that i think is great for the msi and then also Execute-MSI that’s great to really ensure version removal. For the .exe i use Execute-Process. I use Execute-ProcessAsUser but don’t get that far regarding the other profiles…?
Lets say i have a computer that is locked down for computer installs / HKLM.
Then we have some users that share the same computer and they have found a “fun” software that installs in HKCU / user profile. So they one by one install this software one at a time. How do i clean it?
There are many ways to do that, it depends which one suits you best. For example, does it need to run regularly or only once? etc. So, you can add a compliance item with remediation. You can add a registry that runs a script file in the run or runonce on the user profile. You can make a task sequence. You can even make a per user deployment type.
Thanks for the solutions!
I have a collection for all computers that have the “fun” install. But the computer could contain several profiles that contains the “fun” install. I want to push the job to cleanup each computer.
Im thinking that all the suggestions you made needs an user login for a cleanup or that the job is similar to That-Annoying-Guy
but with modifications how, to what he says?
If you already have a collection, then create a deployment type and under user experience select Install for user, Only when a user is logged on. On the uninstall command add msiexec /x …
If there are multiple product codes, then you need to use a script for the uninstall command.
This way, the application will be uninstall when the user logs on the pc.
You can’t uninstall from the cached users. You need to wait for them to log on. Loading the user registry hive, will not help you and is very complex. You will need to remove the app registries, but also the msi registries from a script.