cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

DumpUsersByGroup on a for loop

Jump to solution

I am creating a script to move my disabled users to my Disabled Users Group and want to use a for loop and doing sbadmcl -command:DumpUsersByGroup.  My problem is that I get an error message when I run it because I am reading the group names out of a file.

for /F "usebackq" %%i in ("C:\Program Files\McAfee\ScriptLogs\Move Disabled Accounts\eemgroups.txt") do "C:\Program Files\McAfee\Endpoint Encryption Manager\sbadmcl" -command:DumpUsersByGroup -Group:"%%i" -Status:DisabledOnly -File:"C:\Program Files\McAfee\ScriptLogs\Move Disabled Accounts\movedisabledaccounts.txt" -adminuser:%adminuser% %adminauth%

I have three users on the eemgroups.txt. I can see the loop working because it does it three times, but I get an error message:

O:\Scripts\MoveDisabledUsers>listdisabledusers.bat

McAfee Endpoint Encryption Scripting Tool
Copyright ⌐ 1991-2010 McAfee, Inc. All Rights Reserved.

Executable version : 5.2.5.0
DLL version        : 5.2.5.8

>>> Connecting to "McAfee Endpoint Encryption Database"
>>> Logging on to the database as "SBAdminba"
>>> Logon successful
>>> Opening dump file "C:\Program Files\McAfee\ScriptLogs\Move Disabled Accounts\movedisabledaccounts.txt"


Connection result:

ResultCode = 0x00000000
ResultDescription = The operation completed successfully.


Command result:

Command = DumpUsersByGroup
ResultCode = 0xdb000004
ResultDescription = The name was not found in the database


and then you see it done two more times after this...............

The file gets created by is blak:  SBADMCL Dump Users By Group Report

I also like to know if it is going to rewrite the file every time the loops runs the command, and how do I get it to append instead of re-writting the file ?

Message was edited by: mariosanchez on 12/10/10 11:12:08 AM CST
1 Solution

Accepted Solutions
Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 2 of 6

Re: DumpUsersByGroup on a for loop

Jump to solution

either the group name in the file does not exist, or the user name you're trying to login with.

you can't get it to append each time, you'll have to create unique files then merge them afterwards - the command does not have an "append to file" option.

This would be simpler if you did it in VBS or C# etc of course 😉

5 Replies
Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 2 of 6

Re: DumpUsersByGroup on a for loop

Jump to solution

either the group name in the file does not exist, or the user name you're trying to login with.

you can't get it to append each time, you'll have to create unique files then merge them afterwards - the command does not have an "append to file" option.

This would be simpler if you did it in VBS or C# etc of course 😉

Re: DumpUsersByGroup on a for loop

Jump to solution

Please post "eemgroups.txt" file.

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

Re: DumpUsersByGroup on a for loop

Jump to solution

not sure how seeing the group file is going to help, unless you can also see the names of the groups in the OP's database?

Re: DumpUsersByGroup on a for loop

Jump to solution

It could be just a parsing issue, I want to check that first.

Re: DumpUsersByGroup on a for loop

Jump to solution

The eemgroup.txt has

CFW LIbrary

CFW Library Admins

CFW Municipal Courts

The for loop is reading the file, I think that is just the way that the command executes. This loop does not have a problem deleting users listed on a file, but when it does the DumpUsersByGroups is reading three diferent groups and I do not think that is pausing before running the second group.

I can run the command independently for each group and create their ouw file and consolidate at the end, I guess

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community