Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Monday, November 7, 2011

BlackBerry Services Not Starting Correctly

I found a couple of articles related to an issue with our Blackberry Enterprise Services not communicating with our user's BlackBerry phones. Apparently, the services didn't start correctly. We had been receiving the following events:

Event ID : 20000
Source : ExchangeConnector, BlackBerry Messaging Agent Localhost Agent 1, BlackBerry Policy Service, BlackBerry Synchronization Service
Description : BIPPeClient::Connect: Error calling host "localhost" 127.0.01 (10061)
The cause is that BlackBerry services need to be started in the correct order or you’ll basically experience the lack connectivity and communication issues that we had been experiencing.
The official Blackberry Support article KB13718 describing how to properly restart or start the Blackberry Services, which states:
"...
The correct order to start the BlackBerry Enterprise Server services is detailed below:

1.BlackBerry Router
2.BlackBerry Dispatcher
3.BlackBerry Controller
4.All remaining BlackBerry Enterprise Server services
..."
-http://btsc.webapps.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB13718

I found the blog post, by John McLagan, which took it a step further by showing how to assign service dependencies, so that the services are FORCED to start in the correct order by using regedit. You can check his steps out, but you’ll see my steps below that I feel are less precarious then jumping into the registry, but keeps the underlying premise. http://www.johnmclagan.com/blog/2009/2/24/blackberry-messaging-agent-20000-is-showing-in-the-applicati.html

I liked everything John said to do except the regedit part, so I substituted it for the old service control command (Sc.exe). As Microsoft will tell you, "... You can use Sc.exe to help develop services for Windows. Sc.exe, which is provided in the Resource Kit, implements calls to all of the Windows service control application programming interface (API) functions. You can set the parameters to these functions by specifying them on the command line. Sc.exe also displays service status and retrieves the values stored in the status structure fields. ..." http://support.microsoft.com/kb/251192

I feel it’s safer to edit the services using Sc.exe than using the registry (regedit.exe) and it left out the required reboot of the BlackBerry Server system in John's directions. I tested it on our Windows Server 2003 R2 SP2 running Blackberry Enterprise Server for Microsoft Exchange 5.0.1.

  1. Open the command prompt
  2. Set the Blackberry Router, Dispatch, and Controller services be dependent using the sc (service control command) by typing:
    
    sc config "Blackberry Controller" depend= "Blackberry Dispatcher"
    sc config "Blackberry Dispatcher" depend= "Blackberry Router"
    
 You should know have the dependencies visible from within the service control panel. You also will now be able to restart the three main services by just restarting the Blackberry Router services.
Note: Our Mail Store Service, Policy Service, and Synchronization Service are set to manual and stop and restart with the other three services, so I didn’t set their dependencies. The Blackberry KB mentions to set dependencies to the other services, but in our case, I didn’t see the need.
If you have a minute, comment if it did or didn’t help with a why and how. Thanks!

Tuesday, October 18, 2011

Clearing All Logs

I've had the need to clear log files on multiple Windows Server 2008 R2 testing machines - more specifically virtual machines - and there was no easy way I could find to do this task. I wasn't going to open every log file in Event Viewer. I'd rather let a for loop do that for me, or a drinking bird.

Wrote a song about it. Like to hear it? Here it goes!

via Command-Line (Run as Administrator)

for /f %e IN ('wevtutil el') do wevtutil cl "%e"


or via batch file (.cmd or .bat)


@echo off
:: Clear all logs
::  10:55 AM 10/18/2011 Justin
::   http://justin-bennett-msjc.blogspot.com/
::
::
echo Clearing all log files
echo CRTL-C to abort within 10 secs.
echo .
ping 127.0.0.1 -n 11 > nul
color 07
@echo on
for /f %%e IN ('wevtutil el') do wevtutil cl "%%e"



Image From King-Size Homer - Simpsons Wiki, http://simpsons.wikia.com/wiki/King-Size_Homer