Hello, I’m trying to move create some Fixlet messages using action scripts and I’m not sure if I’m doing the proper thing. The script will work, but the test computer will never report having “completed” the installation (status: wait).
The agent runs as the SYSTEM account so it won’t have access to shares by default… It is probably best to download the package to the agent (use the software distribution wizard).
The “Failed” status means something special when running Fixlets (because fixed/failed status is determined by the relevance of the Fixlet)… See: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=68 (if you are running Tasks or custom actions, completed/failed status is determined if all lines executed).
Here are some examples to run some scripts:
waithidden cmd.exe /C C:\test.bat
waithidden cscript.exe C:\test.vbs
waithidden msiexec.exe C:\test.msi /quiet
Note: actions run with a current working directory of the directory of the Fixlet site (not the folder the file was downloaded in)… So if your batch script is expecting files from the extracted package, then add “cd __Download” to the front of your batch script before you run it…)
if exist “%appdata%\Microsoft\Signatures\Cogeco.sig” echo Signature files already installed > “%appdata%\Microsoft\Signatures\Cogeco.log”
if not exist “%appdata%\Microsoft\Signatures\Cogeco.sig” copy /y “\cogeco.com\netlogon\itsd\templates\signature\Cogeco.*” “%appdata%\Microsoft\Signatures”
Execute the following VBS:
\cogeco\netlogon\CMAgent.vbs
I know I cannot run a script using a URL, but how do I download it to the Bigfix server ?
Also, can I merge a REG KEY and a CMD file in the same script ?
I’m trying the following and I’m getting a “failed” result:
You are on the right track… Since the opening curly brace “{” is a special character in actionscript, it needs to be escaped (here is another example: http://forum.bigfix.com/viewtopic.php?id=4125)
You can’t run cmd file or vbs on a share because the agent runs as SYSTEM and doesn’t have access to the network files. You will need to put them in a folder and use the software distribution wizard to deploy the folder… Then you can add the regset to the top of the action.
It works, thanks ! Ok, I know I said last question previously…
Is there any advanced guide to scripting, because the 4 pager that I have is kinda… basic !
Also, we are using a VBS to deploy our antivirus and it doesn’t seem to work when deployed using Bigfix. The reason we are using this script is because it checks for the OS language version and that option doesn’t seem to exist in Bigfix.
I know the regkey that needs to be checked, but could you please provide me with is the EXACT code I should use if I want to look for a value under a regkey ?
You can definitely use BigFix to check for specific languages. We use relevance like this in our patch content:
(language of version block of file “kernel32.dll” of system folder contains “Japanese”) AND ((not exists key “HKLM\System\CurrentControlSet\Control\Nls\MUILanguages” of registry) OR (not exists value of key “HKLM\System\CurrentControlSet\Control\Nls\MUILanguages” of registry))
If you want to check the value you posted, you can use this:
exists value “InstallLanguage” whose (it as string = “040C”) of keys “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\Language” of registry
At a minimum, I would suggest using the ‘CurrentControlSet’ key rather than ControlSet001
Thanks Jesse, I found it finally and that seems to be working (the relevance), although the installation doesn’t seem to be working. I’ve created another post for that issue, maybe you can have a look at it.
And although it actually writes the key to the registry, the result is still “Failed”. Relevance is “All computers”.
What am I missing ? Is there an “end” to put at the end of the script ? I’ve also tried to enable the “Custom success criteria” and tried the three possibilities to set the “Consider this action successful when…” and it still gives me a “Failed” result, unless I chose “all lines of the action script have completed successfully”, which is not a good option for me, as I need to know if the key was actually applied.
If it’s a Fixlet you will want to use relevance that checks the value of the key. You relevance should be something like this:
exists key “HKEY_CLASSES_ROOT\CLSID{020f6116-407b-11d3-a3bb-00c04fa32518}\InprocServer32” whose (not exists value “ThreadingModel” whose (it as string = “Apartment”) of it) of registry
A Fixlet with the above relevance would be applicable if the key exists but the value doesn’t exist or has an incorrect value. It will be considered successful if the relevance evaluates to false after the action has completed.