BigFix Actions allow a console operator to take virtually any action on BigFix client computers. These actions can be embedded in custom content (Fixlets and Tasks) or can be used in custom actions. You can set the permissions of the BigFix console users so they can be given custom content/action capabilities to send actions to BigFix clients by using the BigFix Admin Tool.
Note: Custom content is not available in BigFix Standard Edition.
In addition to the standard BigFix Action Commands, the following actions are also supported:
To use custom actions:
To create custom content (for more information about authoring custom content, go to Fixlet Authoring):
The Windows action language has the ability to run embedded relevance expressions within the action. This adds significant power to the action language. Suppose you want to run an application that could be installed anywhere on a computer. If you had to hardwire a path, then it would be difficult to create an action that would work in all situations. However, if there was a registry value that contained the path to the application, you could use an embedded relevance expression to look up the value then run it. The resulting action might look like this:
run "{pathname of windows folder}\notepad.exe"
run "{pathname of parent folder of regapp "myapp.exe"}\myapp.exe"
run "{value "PathToEXE" of key "HKLM\Software\MyApp" of registry}"
Note: If your action contains curly braces you will need to escape them for your action to work properly. More info at: https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0023219
Action language will ignore all lines that start with //. This makes it easy to add comments to an action for reference. For example:
// Action to stop the Messenger service so that users do not receive
// spam-like message pop-ups
dos net stop "Messenger"
Following are a list of commonly used actions and some examples. For more details on all the possible actions, syntax, failure conditions, etc., see the Action Guide.
Action language provides built-in file operation commands to allow quick simple operations.
delete "<filename>"
move "<source filename>" "<destination filename>"
copy "<source filename>" "<destination filename>"
download <url>
copy "c:\testing\testfile.txt" "c:\testfile.txt"
copy "{pathname of system folder}\mshtml.dll" "C:\backupfiles\mshtml.dll"
move "d:\testfile.txt" "d:\temp\testfile.txt"
download http://download.microsoft.com/download/e/6/a/e6a04295-d2a8-40d0-a0c5-241bfecd095e/w2ksp4_en.exe
download http://besserver.companyname.com/downloadfolder/customapp.exe
download http://192.168.100.134:52311/download2/myapp.zip
delete "c:\testfile.txt"
delete "{pathname of windows folder}\virusfile.exe"
delete
command will fail if the file cannot be delete (this could happen if the file was READ-ONLY or if there was a permissions problem with the SYSTEM account), but the command will succeed if the file does not exist.copy
and move command will fail if there is already a file name the same as the destination file.download
command will put the file in the "__BESData\actionsite\__download" folder of the BigFix client folder. (The default is "C:\Program Files\BigFix Enterprise\BigFix Client\__BESData\actionsite\__Download").download
command specifies a URL, the BigFix client will receive all files through the BigFix Server and BigFix Relays (unless explicitly told to download from the Internet by specifying custom settings) as usual.Actions can also easily manipulate the registry by creating, changing, or deleting registry values.
regset "<registry key>" "<value name>"=<value>
regdelete "<registry key>" "<value name>"
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\TestKey]" "testValueName"="testValue"
regset "[HKEY_LOCAL_MACHINE\Software\OtherApp]" "TestDWORDValue"=dword:00000014
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\TestKey]" "ActionTime"="{now}"
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\OtherApp2\" "Path2exe"="c:\\program files\\otherapp\\otherapp.exe"
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\OtherApp2\" "Path2exe"="{escapes of "c:\program files\otherapp\otherapp.exe"}"
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\TestKey]" ""="This is the new default value."
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\TestKey]" "ExampleBinaryValue"=hex:4d,49,4d,45,2d,56,6f,6e,3a,20,31,2e,30,0a,43
regdelete "[HKEY_LOCAL_MACHINE\Software\AnotherApp]" "ValueName"
regset
command will create the key and value if they do not already exist. If the value already exists, it will be overwritten.regset
syntax obeys the same rules as the regedit program. If you would like to see an example of the syntax for any particular registry value, export a .reg file from regedit.exe and look at the file in a text editor.Regdelete
does not delete registry keys. See the Windows Action Guide for more details on deleting a registry key.Actions can easily run files to provide almost limitless power.
dos <dos command>
run "<full path to executable>" [<command-line options>]
wait "<full path to executable>" [<command-line options>]
script "<full path to script>"
dos cmd /c rd /q /s "C:\program files\kazaa"
dos net start MSSQL
dos net send MYCOMPUTER The version of the BESClient.exe is {version of regapp "BESClient.exe"}.
wait "C:\temp\download\setup.exe" /s
wait "{pathname of windows folder}\temp\341k3d\runmeandwait.exe"
run "{pathname of regapp "otherapp.exe"}"
run "C:\customapp\customapp.exe" /runquiet /opt2
script customscript.vbs
dos
command will create a dos window on the BigFix client computer for the duration of the action.Run
and wait
are equivalent commands except that run
returns immediately and wait
will wait for the application to exit.script
command will run visual basic and JavaScript files.download
command to first download the file to the computer, then run the file.continue if <{relevance condition to evaluate}>
pause while <{relevance condition to evaluate}>
// download Windows 2000 SP4, verify the sha1 checksum and size, then run the service pack
download http://download.microsoft.com/download/e/6/a/e6a04295-d2a8-40d0-a0c5-241bfecd095e/w2ksp4_en.exe
continue if {(size of it = 135477136 and sha1 of it = "fadea6d94a014b039839fecc6e6a11c20afa4fa8") of file "w2ksp4_en.exe" of folder "__download"}
wait __download/w2ksp4_en.exe -q -z -n -o
// uninstall myapp.exe, wait until it is uninstalled, then run installer (Note: if uninstaller fails, this action will wait indefinitely)
continue if {exists regapp "myapp.exe"}
run "C:\myappfiles\myapp-uninstaller.exe"
pause while {exists regapp "myapp.exe"}
wait "C:\myappfiles\myapp-installer.exe"
pause while
command because if the relevance clause doesn't become false, the action will stay paused until the BigFix client is restarted.restart [<delay seconds>]
shutdown [<delay seconds>]
setting "[name]"="value" on "[effective date]" for client
shutdown 60
restart 30
shutdown
restart
// Restart before Jan 1, 2005
restart {("Fri, 31 Dec 2004 23:59:00 -0000" as time - now) / second}
// Shutdown in 3 hours
shutdown {(hour * 3) / second}
setting "Test Setting"="Test Value 1" on "{parameter "action issue date" of action}" for client
setting "_BESGather_Download_CacheLimitMB"="4096" on "Tue, 07 Jun 2006 08:10:17 +0000" for client
restart
and shutdown
commands work the same way as the restart/shutdown options in the "Take Action" dialog in the BigFix console.On Unix/Linux computers with the BigFix client, you can choose to run shell scripts or use the BigFix Action Language.
#!/bin/sh
or another interpreter as the first command in your action.// download a file
download http://somesite.com/download/filetodownload
// create a file with shell script commands using the "appendfile" action, for instance find a pattern in the file, then output a file with the results
appendfile #!/bin/sh
appendfile grep somepattern filetodownload | wc -l > outputfile
// rename the script
move __appendfile myscript
// give permissions to run the script
run chmod 777 myscript
// run the script
wait myscript