Hack 83. Set Owner Info for All Devices


Set owner information on devices over the air with no user intervention.

When a password-protected device goes into the locked state after inactivity, it can display a custom message that identifies the owner of the device. This can be crucial if you have any devices that get lost if there is no owner information specified in the device, there is no way for someone to know who owns the device to return it. With older versions of BlackBerry Enterprise Server, you had to rely on the user to input owner information in the Owner section of the Options program on his device. With BES 3.5, you could send the owner information over the air, but you had to use the BlackBerry Management tool's GUI to set the information for each user one at a time. If you are using BlackBerry Enterprise Server Version 4.0 or greater, you can use the BES User Admin tool to set owner information remotely from a command prompt.

7.13.1. Set the Owner Info Using the GUI

To set the owner information for a user using the BlackBerry Management the name of the user and any extra information, as shown in Figure 7-16.

Figure 7-16. Setting owner information using the GUI


After the device is in a coverage area for a few seconds, it will pick up the change without any indication to the user. Figure 7-17 shows the device after retrieving the owner information from the server. This provides a good way for the owner to give a little bit of information to help recover a device in the event it is lost, without compromising any potentially proprietary information to the finder.

Figure 7-17. The owner information is displayed when the device is password locked


7.13.2. Set the Owner Info Using the Command Line

You can set owner information using the GUI, but your mouse hand is likely to lock up with rigor mortis if you have to do it for more than a few users. Once you've set up the BES User Admin service [Hack #81], you can use the following command to set the owner information from a command prompt. Of course, you'll have to substitute the information specific to your environment (be sure to type this all on one line).

 besuseradminclient  n server_name  b bes_name  p password set_owner_info  u "/o=org/ou=site/cn=container/cn=alias" name "David M. Mabe"  info "If found call 919 960 5555" 

The results of the command should be similar to the following:

 BlackBerry User Administration Client Version 4.0.1.8 Copyright (c) Research In Motion, Ltd. 1997-2004. All rights reserved. Modification date: May 2 2005 besuseradminclient  n server_name  b bes_name  p password set_owner_info  u "/o=org/ou=site/cn=container/cn=alias" name "David M. Mabe"  info "If found call 919 960 5555" BESUserAdmin::main - Log Start BESUserAdmin::DoSetOwnerInfo - ITAdmin SET_OWNER_INFO… BESUserAdmin::DoSetOwnerInfo - …done. BESUserAdmin::main - Log End 

7.13.3. Hack the Hack

While this is a bit easier on your mouse, you still have to complete the command one user at a time. Here is some Perl code to read from a tab-delimited input file and run the command once per line in the file. Set up your input file (input.txt) as follows:

 Server_name bes_name account_info owner_name owner_info 

The Perl code follows. You'll need to substitute your BES User Admin service password for the $PASSWORD variable. You may have to change the value of $BES_USER_ADMIN_CLIENT if it's in another directory and not in your path:

 #! perl -w use strict; my $BES_USER_ADMIN_CLIENT = "besuseradminclient.exe"; my $PASSWORD = "password"; my $INPUT_FILE = "input.txt"; open INPUT, $INPUT_FILE || die "Can't find $INPUT_FILE: $!\n"; while (<INPUT>) { chomp; my ($server,$bes,$account,$owner,$info) = split /\t/; my $system_command = "\"$BES_USER_ADMIN_CLIENT\" -n $server " .   "-b $bes " .   "-p $PASSWORD -u $account -name \"$owner\" -info \"$info\""; my $return_code = system $system_command; if ($return_code) { print "There was an error for $account\n"; } else { print "Success for $account.\n"; } } close INPUT; 

Make sure that input.txt is in the current directory, save the previous code in a file called set_owner.pl, and run the program by running this command.

 C:>perl set_owner.pl 



BlackBerry Hacks
Blackberry Hacks: Tips & Tools for Your Mobile Office
ISBN: 0596101155
EAN: 2147483647
Year: 2006
Pages: 164
Authors: Dave Mabe

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net