1 2 Previous Next 11 Replies Latest reply on Jan 29, 2010 3:49 PM by cortez002

    delete user script

      Hi Everyone,

       

      I'm trying to find a script or xml file that will allow me to run through the entire User DB without a  group association to delete users from a .csv file. I've had no luck modifying what I've been provided with so far.

       

      Thanls,

      Carlos

        • 1. Re: delete user script

          Maybe you should include what have you been provided with and point out areas that you have difficulties with?

           

          If you have "file.csv" with this info:

           

          "User 1","Group A"

          "User 2","Group B"

           

          You could run:

           

          for /f "tokens=1,2* delims=," %%i in (file.csv) do (
          sbadmcl.exe  -command:DeleteUser -database:"DATABASE" -user:%%i  -group:%%j -recycle:true -adminuser:ADMIN -adminpwd:PASSWORD
          )

           

           

           

           

          typo, changed "sbadmin" to "sbadmcl" on 1/26/10 8:57:59 AM EST
          • 2. Re: delete user script

            I have 368 .csv files of users that have been terminated. Some are not even Encryption users. They just dumped the whole list on me. Now, they have over 30 SB groups. The main user groups (no admins) correspond with group names ie group "A", "B","C", etc. Problem is, the csv files are not created with just the users in the A group or B group. There is a mix of every single possible user in every group so I am trying to bypass specifying a group altogether, because if I don't......that's a lot of scripts. I've spoken with gold support and they have told to speak to sales...which I have worked with before as McAfee consultant. I will try what you suggested tomorrow. There is a script out there that does it, but I can't get a hold of it.

            • 3. Re: delete user script

              I've attached a sample file that was given to me by sales. They said all I had to do was change all the create commands to "delete".......not working

              • 4. Re: delete user script

                you don't need to specify the group parameter in the delete user command. I'm not sure where you got that from? ;-)

                • 5. Re: delete user script

                  I just tried it, it works fine.

                   

                  I think your CSV files are formatted differently to what the script expects - why not post a sample of the file you are trying to process?

                  • 6. Re: delete user script

                    I've attached a sample file of whats in the csv files. I ran your script and i get %%i was unexpected at this time. I'm testing at home with build 5710....going back to 5.2

                    • 7. Re: delete user script

                      yes, the script expects to find "user,group" and your files are just "user".

                       

                      you need to make your own script to walk your file - it's only text and batch files though, so that's easy.

                       

                      you could just use "for /f %l in (sample.txt) do sbadmcl -command:deleteuser -user:%l  -adminuser:.. -adminpwd:..."   on a command line.

                      • 8. Re: delete user script

                        for some reason its still not pulling from the csv file.....I wrote it right into the command line and get error code "0xdb000004". the name was not found in the database...but when i put in one of the user's names...poof...its gone and works

                        • 9. Re: delete user script

                          instead of running "sbadmcl.." , use "echo %l" instead. This is just a batch file - it's not rocket science

                           

                          You might well get a lot of 04 errors - it depends if the users exist etc..

                           

                          you also might want to consider recycling them, rather than deleting them (just in case).

                          1 2 Previous Next