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, 01:18 PM
Otto's Avatar
Proprietor
 
Join Date: Nov 2008
Location: Atlanta, GA
Posts: 2,033
Blog Entries: 14
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, 5.0)

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, 02:25 PM
BES Administrator
 
Join Date: Apr 2009
Location: DFW
Posts: 14
Default

Thanks Otto, this will work for any future deployments I may have.
__________________
BES Admin for Dell\Perot Systems Leveraged Clients
35+ Client environments
50+ BES Servers (4.1.6, 5.0.x)
~20,000 devices\users
9900/7.1.0.190
Certified Support Specialist
Reply With Quote
  #3 (permalink)  
Old 01-11-2010, 04:01 PM
Otto's Avatar
Proprietor
 
Join Date: Nov 2008
Location: Atlanta, GA
Posts: 2,033
Blog Entries: 14
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, 5.0)

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, 11:50 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
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/
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
BES User Role Listing Script Joolie Scripts & Tools / Hints & Tricks 9 02-10-2011 04:12 PM
SQL Script to grab user / handheld data hdawg Scripts & Tools / Hints & Tricks 15 10-04-2010 02:47 PM
KB18114 - How to rename the line labels in BlackBerry Mobile Voice System version 4.6 hdawg Featured BlackBerry KB Articles 0 07-30-2009 10:10 AM
SQL Script to search for user by phone number Snapp Scripts & Tools / Hints & Tricks 5 06-03-2009 08:08 PM


All times are GMT -4. The time now is 01:36 AM.
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.


 

SEO by vBSEO 3.3.2 PL2