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



Reply
LinkBack Thread Tools Display Modes
NEEDED: SQL script bes users per exchange server
 
  #1 (permalink)  
Old 06-11-2009, 12:06 PM
RadHaz75's Avatar
BES Expert
 
Join Date: May 2009
Location: Philadelphia, PA
Posts: 98
Default NEEDED: SQL script bes users per exchange server

I am looking for a script to parse the BESMgmt DB and give me a list of how many Blackberry Users per Exchange server there are. I have limited SQL experience and can get SELECT ServerDN from UserConfig but I'm sure there is a better way to collect and group the results using COUNT or something but it is beyond me (especially on my last day at work for a week and a half).

any help would be appreciated. thanks.

ps script needs to be SQL 2000 and 4.1.6 compatible.
__________________
Two months ago, I saw a provocative movie on cable TV. It was called The Net, with that girl from the bus.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-12-2009, 09:58 AM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

DECLARE @ZZZtemp TABLE (
UserName VARCHAR( 256 ),
ServerName VARCHAR( 256 ))

INSERT INTO @ZZZtemp (UserName, ServerName)
SELECT DisplayName, ServerDN
FROM UserConfig

SELECT ServerName, (COUNT (*)) AS NumUsers FROM @ZZZTemp Z GROUP BY Z.ServerName
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #3 (permalink)  
Old 06-12-2009, 02:36 PM
Joolie's Avatar
Super Moderator
 
Join Date: Dec 2008
Location: West Michigan
Posts: 763
Default

Nice. I like this one.
__________________
You may know me as Juwaack68
Reply With Quote
  #4 (permalink)  
Old 06-16-2009, 07:49 PM
RadHaz75's Avatar
BES Expert
 
Join Date: May 2009
Location: Philadelphia, PA
Posts: 98
Default

ahh thanks howie. i've forgotten more sql than u'll ever know! actually strike that, reverse it.
__________________
Two months ago, I saw a provocative movie on cable TV. It was called The Net, with that girl from the bus.
Reply With Quote
  #5 (permalink)  
Old 07-10-2009, 07:56 AM
BES Activated
 
Join Date: Jul 2009
Location: N/A
Posts: 9
Default

There is also a free app called BERRYSTATS. BerryStats and Useful tools for BlackBerry Administrators it is very useful for this type of thing as well as other data / reporting requirements.
Reply With Quote
  #6 (permalink)  
Old 07-28-2009, 10:39 AM
RadHaz75's Avatar
BES Expert
 
Join Date: May 2009
Location: Philadelphia, PA
Posts: 98
Default

using your script i get...

Server: Msg 260, Level 16, State 1, Line 5
Disallowed implicit conversion from data type ntext to data type varchar, table 'tempdb.dbo.#31654011', column 'ServerName'. Use the CONVERT function to run this query.

I have tried using CONVERT and CAST every way google will show me but i still can't get it to work. help?
__________________
Two months ago, I saw a provocative movie on cable TV. It was called The Net, with that girl from the bus.
Reply With Quote
  #7 (permalink)  
Old 07-28-2009, 09:55 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

Here's a much more simple version ... does this work?

SELECT CAST(ServerDN AS VARCHAR(256)) , COUNT (*)
FROM UserConfig
GROUP BY CAST(ServerDN AS VARCHAR(256))
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #8 (permalink)  
Old 07-29-2009, 09:15 AM
RadHaz75's Avatar
BES Expert
 
Join Date: May 2009
Location: Philadelphia, PA
Posts: 98
Default

holy crap awesome.
__________________
Two months ago, I saw a provocative movie on cable TV. It was called The Net, with that girl from the bus.
Reply With Quote
  #9 (permalink)  
Old 07-29-2009, 09:23 AM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

Quote:
Originally Posted by RadHaz75 View Post
holy crap awesome.
Translation ... Yes?
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #10 (permalink)  
Old 07-31-2009, 10:55 PM
AUTiger92's Avatar
BES Expert
 
Join Date: Jan 2009
Location: Alabama
Posts: 82
Default

will that script work against SQL 2005?
__________________
AUTIGER92
Exchange\Blackberry Admin
4 - BES Servers (4.1.6), 3 Exchange Organizations,
~1800 BB Users, and a headache.
War Eagle!!
Reply With Quote
  #11 (permalink)  
Old 08-01-2009, 08:48 AM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

Yes, very much so.
__________________
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 5.04 script needed unreal1171 Scripts & Tools / Hints & Tricks 1 04-04-2015 12:20 PM
SQL Script - Check users with TimeZone records on their devices noname Scripts & Tools / Hints & Tricks 0 11-17-2010 05:01 AM
KB04586 - BlackBerry Enterprise Server support for Microsoft Exchange Server 2003 SP2 hdawg Featured BlackBerry KB Articles 0 06-25-2009 11:16 AM
KB12483 - Set Exchange Server 2007 permissions using the Exchange Management Shell hdawg Featured BlackBerry KB Articles 1 05-26-2009 02:06 PM
SQL script to find users' device free memory Joolie Scripts & Tools / Hints & Tricks 4 01-31-2009 09:44 AM


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


 

SEO by vBSEO 3.3.2 PL2