ForceSync with McAfee EE / SafeBoot with AutoIt Functions
March 13th, 2009
As promised, here is a sample of code that causes a client to ForceSync using the AutoIt functions I wrote in this previous post.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #Include <_McAfeeEndpointEncryption.au3> ; Silent RUN Errors AutoItSetOption("RunErrorsFatal", 0) ; Register COM $regCom = _EEPCRegisterCOM() if @error Then consolewrite("Error at line " & @ScriptLineNumber & " - " & @error) exit(11) EndIf ; Connect to Database $eeConnect = _EEPCConnect("installer", "mypassword", false) if @error Then consolewrite("Error at line " & @ScriptLineNumber & " - " & @error) exit(11) EndIf $ret = _EEPCExecute($eeConnect, "ForceSync") if @error Then consolewrite("Error at line " & @ScriptLineNumber & " - " & @error) exit(11) EndIf $ret = _EEPCDisconnect($eeConnect) if @error Then consolewrite("Error at line " & @ScriptLineNumber & " - " & @error) exit(11) EndIf |
After including the UDF in Line #1, we register the COM on Line #7, then connect to the database in Line #14. The $eeConnect variable now holds the connection reference so that we can issue one or more commands to the database.
On line #20 we issue ForceSync, and if you’re watching your client status window, you should see the sync startup Note that this may not work if you’ve disabled the ability to manually sync in your policy.

thanks for your udf, can you post an example with a more detailed command like creating a user then assiging it to a device
@zn
Hi ZN,
Here’s a pretty bare bones sample, you’ll probably want to add some error checking and logging later. Basically we just use CREATEUSER to create the new user, and SETUSER to assign that account to a computer.
If your users are being created by an AD or LDAP synch, you should use that instead so that your users created by those connections stay in sync with their original objects and you don’t need to maintain two user databases.