cancel
Showing results for 
Search instead for 
Did you mean: 
hasi99
Level 9
Report Inappropriate Content
Message 1 of 9

Bulk move of Machines

Jump to solution

Hi All,

Is there a way of moving a list of existing machines between groups in the EEM console by using a text file or similar, rather than having to individually move each machine one at a time ?

Thanks.

1 Solution

Accepted Solutions
hasi99
Level 9
Report Inappropriate Content
Message 8 of 9

Re: Bulk move of Machines

Jump to solution

Thank you very much for the example, just got round to testing it.

As it turned out (after 2 hours )  the following worked for me:

for /f "tokens=1,2 delims=," %%i in (movemachines.csv) do (sbadmcl -command:movemachine -machine:%%i -newgroup:%%j -adminuser:myadminuser -adminpwd:myadminpassword)

Also, becuase my group name had spaces in it I had to enclose in quotes.

But job done

8 Replies
Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 2 of 9

Re: Bulk move of Machines

Jump to solution

sure - you can use the movemachine command of the API in either a script or batch file.

hasi99
Level 9
Report Inappropriate Content
Message 3 of 9

Re: Bulk move of Machines

Jump to solution

Well, I've managed to get something, but have ended up with this error:

ResultCode = 0xe0020018

ResultDescription = Endpoint Encryption disk driver not present

D:\Program Files\SBAdmin>sbadmcl -AdminUser:xxx -AdminPwd:xxxxxx -command:move
machine -machine: "-file:test.txt" -NewGroup:"CYP - Locality Services Machines"

McAfee Endpoint Encryption Scripting Tool
Copyright ® 1991-2008 McAfee, Inc. All Rights Reserved.

Executable version : 5.2.3.0
DLL version        : 5.2.3.5

>>> Connecting to "SafeBoot Administration Database"
>>> Logging on to the database as "xxx"
>>> Logon successful
>>> Getting machine id


Connection result:

ResultCode = 0x00000000
ResultDescription = The operation completed successfully.


Command result:

Command = movemachine
ResultCode = 0xe0020018
ResultDescription = Endpoint Encryption disk driver not present

Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 4 of 9

Re: Bulk move of Machines

Jump to solution

I think you have a space between -machine: and the value itself. Plus, unless the machine is really called "-file:test.txt" you can't do things like that. The -machine option does not take a file name as an argument (where did you read that!).

Best thing to do is use a simple batch "for" loop to read the value out of the file and punch it into the command. It will be heavy on the database though - it would be far more efficient to write this as a VBS or powershell script.

hasi99
Level 9
Report Inappropriate Content
Message 5 of 9

Re: Bulk move of Machines

Jump to solution

if you look hard enough & squint real good you can see most things

thanks for the pointers I'll give it whirl.

SOM2010
Level 10
Report Inappropriate Content
Message 6 of 9

Re: Bulk move of Machines

Jump to solution

You can do this using the sbadmcl.exe within batch "for" loop.  Syntax must be exact.

for /f "tokens=1,2 delims=," %i in (yourfilename.csv) do (sbadmcl -command:movemachine -machine:%1 -newgroup:%j -adminuser:youradminID -adminpwd:youradminpassword)

Where your csv file has 2 columns, first column is a list of machine names, 2nd column is a list of the groupname to move them into (in this case they would be all the same).  

Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 7 of 9

Re: Bulk move of Machines

Jump to solution

and assuming there's no chance of having a comma in a machine or group name

hasi99
Level 9
Report Inappropriate Content
Message 8 of 9

Re: Bulk move of Machines

Jump to solution

Thank you very much for the example, just got round to testing it.

As it turned out (after 2 hours )  the following worked for me:

for /f "tokens=1,2 delims=," %%i in (movemachines.csv) do (sbadmcl -command:movemachine -machine:%%i -newgroup:%%j -adminuser:myadminuser -adminpwd:myadminpassword)

Also, becuase my group name had spaces in it I had to enclose in quotes.

But job done

Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 9 of 9

Re: Bulk move of Machines

Jump to solution

you could have done sbadmcl ... -machine:"%%i" -newgroup:"%%j" etc