This has been tested on BlackBerry Enterprise Server 4.1.6 with BlackBerry User Administration Service 4.1.6, although it should be compatible or portable to any other version.
The scenario requested was to assign multiple users to a certain IT Policy in a multi-server domain. For example, I have 100 users who reside on one of five different BES servers and I want them moved from the Default policy to one named PasswordPolicy.
In this scenario, the input file of the 100 users will consist of the following format:
emailaddress@domain.com BESSERVERNAME
While I'm leaving it up to you to gather this information and place it in this format, the script delimeter can be updated to accommodate your formatting needs.
bbusers.txt:
user1@domain.com NYCBB01
user2@domain.com NYCBB03
user3@domain.com NYCBB01
Command-line w/ variables:
FOR /F "tokens=1,2* delims= " %m IN ('type bbusers.txt') DO BESUserAdminClient.exe -p password -change -u %m -b %n -it_policy PasswordPolicy
Should you want to put this in a batch file, you will need to double-up the quotes:
FOR /F "tokens=1,2* delims= " %%m IN ('type bbusers.txt') DO BESUserAdminClient.exe -p password -change -u %%m -b %%n -it_policy PasswordPolicy
This can obviously be updated to perform any action within the BUA command-line, so have fun and feel free to update this thread with modifications, enhancements, etc.