8 Replies Latest reply on Apr 8, 2011 8:46 AM by SafeBoot

    Bulk move of Machines

      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. Re: Bulk move of Machines

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

          • 2. Re: Bulk move of Machines

            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

            • 3. Re: Bulk move of Machines

              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.

              • 4. Re: Bulk move of Machines

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

                 

                thanks for the pointers I'll give it whirl.

                • 5. Re: Bulk move of Machines

                  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).  

                  • 6. Re: Bulk move of Machines

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

                    • 7. Re: Bulk move of Machines

                      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. Re: Bulk move of Machines

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

                        1 of 1 people found this helpful