Wednesday, July 24, 2013

Quote of the Month:

"Java was having issues, so I re-installed Photoshop and it didn't help"

Tuesday, July 9, 2013

Uninstall BMC Remedy 7.x via SCCM 2012

I'm obviously working late tonight.  Here's another tricky one: Remedy 7.x.  We recently upgraded to Remedy 8.1, and yes we're still way behind.  But here we are.  With 8.X we didn't license for thick clients, we're all web based now.  And what's left after the upgrade is this Remedy client that doesn't do anything left on (according to my collection) 782 machines.  I'm not going to uninstall that many manually.

So you need two files.  1) Options.txt, and 2) UninstallRemedy7.bat.  Put them both in the same folder and make it your soufce directory for SCCM.

Options.txt
--------------
-P installLocation=C:\Program Files (x86)\BMC Software\ARSystem
-U productARSuiteKit


UninstallRemedy7.bat (the following is one line)
---------------------------
start "" "c:\Program Files (x86)\BMC Software\ARSystem\UninstallBMCARSystem\uninstall.exe" -i silent -DOPTIONS_FILE=\\<hostserver>\software\Uninstall_Remedy_7\options.txt

That's it.  Your program just points to the .bat and is ran as admin.  And just because I have a few minutes, here is the query for the collection that I'm using:

select
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System inner join
SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_INSTALLED_SOFTWARE.ProductName like "BMC Remedy Action Request System 7%"

Enjoy,

--Dave

Also worth a note, 7.x installs to program files (x86) vs. 8.x which installs to program files in every case I've looked at (our Dev's have the console).  So even though the above bat/txt would uninstall 8.x, it's hard coded to (x86) so it 'shouldn't'.  I'll find out tonight :)
Wow, why am I just now seeing this:

SCCM 2012 ConfigMgr Survival Guide (via Technet)

Uninstalling non-admin install of Google Chrome

******************
EDIT:  I've heard that some folks are having issues with this process.  I'm currently working on a PowerShell script to run this as system (ie. from System Center or PSExec -s) which will fix a couple things.

EDIT 2: The new version is here:
http://sccmbrokeit.blogspot.com/2013/09/uninstalling-non-admin-install-of.html
******************

This was a fun one.  If a non-privledged user goes to www.google.com/chrome they can get it installed.  I'm not going to tell you how, but leave it to our usrs to find a way.  BTW, I like Chrome and Google as a whole, but I don't need the headache of supporting custom web applications through yet another browser so it had to go.

Since the user isn't privledged, it can't be installed in Program Files.  So the user's profile is used. 
I tried something fancy like:
 
for /D %%G In (%userprofile%\AppData\Local\Google\Chrome\Application\*Do %%G\Installer\setup.exe --uninstall --multi-install --chrome --verbose-logging --force-uninstall

Yes the double dash is needed for the chrome setup.exe.

But 1) that has to run for each user, and 2) it was unreliable, and 3) I don't like it because a user might leave and never come back and I'm stuck looking at a report with his software one it.  My OCD can't stand that.  So I found a link on Google that has all the registry keys that Chrome installs.  Time to undo those:

Windows Registry Editor Version 5.00
 

[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\chrome.exe]

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Chrome"=-

[-HKEY_CURRENT_USER\SOFTWARE\Classes\ChromeHTML]

[-HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\chrome.exe]

[HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
"Chrome"=-

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Chrome]

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome]

[-HKEY_CURRENT_USER\Software\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_CURRENT_USER\Software\Google\Update\ClientState\{8A69D345-D564-463c-AFF1-A69D9E530F96}]
 
[-HKEY_CURRENT_USER\Software\Google\Update\Clients\{00058422-BABE-4310-9B8B-B8DEB5D0B68A}]

[-HKEY_CURRENT_USER\Software\Google\Update\ClientState\{00058422-BABE-4310-9B8B-B8DEB5D0B68A}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\ClientStateMedium\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\ClientState\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]
 
Kick it off via a batch file, which can also do some cleanup.
 
@echo off
regedit.exe /s ~dp0RegEntries.reg
IF EXIST "C:\Users\" (
for /D %%G in ("C:\Users\*") do (
rmdir /s /q "%%G\AppData\Local\Google\Chrome"
        del /f /s /q "%%G\Desktop\Google Chrome.lnk")
)
 
Put the batch and .reg file in the same folder, and advertise out the .batch file through SCCM 2012 as a package.
 
--Dave