(imported comment written by wnolan91)
Examples for you:
MSI - this is uninstalling a MSPatch using the MSI in the uninstall string… you can get the idea…
- wait or waithidden will work but this is a /passive so I wanted the user to see it.
wait msiexec /package {"%7B90110409-6000-11D3-8CFE-0150048383C9%7D"} /uninstall “{values “LocalPackage” of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Patches\587A36CCC9CFD4C4094B08E54E8639C4” of registry as string}” /passive
action requires restart “uninstallkb982311”
BAT - Here is an example of running a bat file, in this case BigFix is restarting the BESClient.
delete __appendfile
appendfile @echo off
appendfile echo Your administrator is restarting the BES Client… Please Wait…
appendfile net stop BESClient
appendfile net start BESClient
delete clientRestart.bat
copy __appendfile clientRestart.bat
runhidden clientRestart.bat
VBS - Here is an example of running a vbs script. This was a script that we created to stop and delete the SMS Service
delete delete_clisvc.vbs
delete __appendfile
appendfile strComputer = “.”
appendfile Set objWMIService = GetObject(“winmgmts:” _
appendfile & “{”{impersonationLevel=impersonate}}"}!\" & strComputer & “\root\cimv2”)
appendfile Set colListOfServices = objWMIService.ExecQuery _
appendfile (“SELECT * FROM Win32_Service WHERE Name = ‘clisvc’”)
appendfile For Each objService in colListOfServices
appendfile objService.StopService()
appendfile objService.Delete()
appendfile Next
move __appendfile delete_clisvc.vbs
waithidden “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” “{pathname of system folder & “\cscript.exe”}” “{pathname of client folder of current site}\delete_clisvc.vbs”
Run as Local Rights - Any time you are running
Anytime you are running wait or waithidden or run or runhidden, without the RunAsCurrentUser.exe then you are running as the Local System Account, or if you modified your service to use a specific domain ID it will run as that. by default it will be Local System Account which works great for us.
Run as User Context - Any time you are running “RunAsCurrentUser” which you can get from the BigFix Site, Anytime you are running the RunAsCurrentUser*.exe it will run as the Logged on User, and will only have access to whatever the logged in user has access to, you will want to restrict these Fixlets/Tasks to “exists current user” in your Relevance.
prefetch RunAsCurrentUser-2.0.2.exe sha1:5512ef51a98dff1aa910a8189a0361c161fa703f size:212992 http://dbfixletsite.us.db.com/downloads/RunAsCurrentUser-2.0.2.exe
utility __Download\RunAsCurrentUser-2.0.2.exe
wait __Download\RunAsCurrentUser-2.0.2.exe --w “{pathname of system folder}\wscript.exe” __Download\Mapxdrive_v1.vbs