Welcome to Port3101.org : Your BES Connection Mark forums read | View Forum Leaders
Port3101.org : Your BES Connection



Reply
LinkBack Thread Tools Display Modes
Command-line Script for User Manipulation via BUA
 
  #1 (permalink)  
Old 12-21-2009, 12:18 PM
Otto's Avatar
Proprietor
 
Join Date: Nov 2008
Location: Atlanta, GA
Posts: 1,807
Blog Entries: 13
Default Command-line Script for User Manipulation via BUA

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.

__________________
BCSA (4.1, 5.0) | BCSD (4.1)

The views expressed by me on Port3101.org are my own and do not necessarily reflect the views of my employer.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-21-2009, 01:25 PM
BES Activated
 
Join Date: Apr 2009
Location: DFW
Posts: 8
Default

Thanks Otto, this will work for any future deployments I may have.
__________________
Creator and admin of the D/FW Blackberry Admins User Group for Public Sector/Education/Healthcare
BES Admin for Perot Systems Leveraged Clients
20+ Client environments
40+ BES Servers (4.0.x, 4.1.6, 5.0.0)
~13,000 devices\users
9000/4.6.0.297
Certified Support Specialist
Reply With Quote
  #3 (permalink)  
Old 01-11-2010, 03:01 PM
Otto's Avatar
Proprietor
 
Join Date: Nov 2008
Location: Atlanta, GA
Posts: 1,807
Blog Entries: 13
Default

If within the same BlackBerry domain, the list for email addresses and BES instance names can be pulled with this SQL query:

SELECT U.MailboxSMTPAddr, S.ServiceName
FROM UserConfig U LEFT OUTER JOIN ServerConfig S
ON U.ServerConfigId = S.Id
__________________
BCSA (4.1, 5.0) | BCSD (4.1)

The views expressed by me on Port3101.org are my own and do not necessarily reflect the views of my employer.
Reply With Quote
  #4 (permalink)  
Old 02-03-2010, 10:50 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,099
Blog Entries: 135
Default

If you want to run this as a script and keep all the output from the command do as Otto says and save to a bat / cmd file ...

Then, at the command prompt execute:

script.bat > output.txt 2>&1

and the complete input/output of the script will be saved to output.txt
__________________
http://blog.port3101.org/hdawg/

The views expressed by me on Port3101 and its affiliated sites are my own and do not necessarily reflect the views of my employer.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:28 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2