Hoping I can get a push in the right direction. I'm looking to uninstall a program on a few hundred PC's. The package was deployed via SCCM , but the uninstall does not work so I dug up an PS script from online.
The following PS Script works just fine if it's ran locally on the clients.
I deploy to the collection that has this piece of software installed but it never runs on them. I have allowed PowerShell execution on the client settings. I can push other SW to these computers by they way.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Hello all
Running SCCM 1606
Hoping I can get a push in the right direction. I'm looking to uninstall a program on a few hundred PC's. The package was deployed via SCCM , but the uninstall does not work so I dug up an PS script from online.
The following PS Script works just fine if it's ran locally on the clients.
$appVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
Get-ItemProperty |
Where-Object {$_.DisplayName -match "Some Application" } |
Select-Object -Property DisplayName, UninstallString
ForEach ($ver in $appVer) {
If ($ver.UninstallString) {
$uninst = $ver.UninstallString
& cmd /c $uninst /u
}
}
I have created a package without any source files.
I have created a program with the following command line
powershell.exe -ExecutionPolicy ByPass -File \\servername\Applications\application\Uninstall\ps\Uninstall.ps1
Runs with Administrative rights
Runs with UNC name
Whether or not a users is logged on.
I deploy to the collection that has this piece of software installed but it never runs on them. I have allowed PowerShell execution on the client settings. I can push other SW to these computers by they way.
Any help would be very much appreciated.
left out some info
Share this post
Link to post
Share on other sites