Friday, May 8, 2009

Exchange 2007 OAB Event Logging

In Exchange 2007 we introduced the Microsoft Exchange Scripting Console as a mechanism for performing Exchange tasks via scripting. The Microsoft Exchange Scripting Console extends the ability to run commands that you want to perform without having to use a graphical interface.

For Exchange 2007 Offline Address Book event logging, there are two commands that you can run from the Microsoft Exchange Scripting Console to set and get the event logging levels.

Set-Event LogLevel - Will set the current event logging levels for all of the components, or a specified component.
[Get Event Log Level] - Will get the event logging level.
The levels of logging that are available: [ Lowest | Low | Medium | High | Expert ]

How to get the current diagnostic logging level for OAB Generation in Exchange 2007
1. Open the Exchange Scripting Console.
2. Type Get-EventLogLevel "MSExchangeSA\OAL Generator"

NOTE: By default the Event Level is set to the Lowest level.
Here is the output from the Microsoft Exchange Scripting Console
Identity : MSExchangeSA\OAL Generator
IsValid : True
ObjectState : Unchanged
Name : OAL Generator
Number : 13
EventLevel : Lowest

How to turn up the diagnostic logging level for OAB Generation in Exchange 2007


1. Open the Exchange Scripting Console.
2. Type Set-EventLogLevel -Identity "MSExchangeSA\OAL Generator" –Level Expert

NOTE: After you hit enter you will not see any output, and this indicates that the logging level has been set.

OPTIONAL COMMNAD: You can also run Set-EventLogLevel "MSExchangeSA\OAL Generator" –Level Expert -vb to output the
information in verbose mode.
(verbose output)
VERBOSE: Beginning the task's processing.
VERBOSE: Processing one object in the task.
VERBOSE: Searching configurable objects "MSExchangeSA\OAL Generator" of type "EventCategoryObject" under the root "$null" on Source "MSExchangeSA\OAL Generator".
VERBOSE: Validating the configurable object "MSExchangeSA\OAL Generator".
VERBOSE: Validating the configurable object "MSExchangeSA\OAL Generator".
VERBOSE: Saving the changes of the configurable object, "MSExchangeSA\OAL Generator" of type "EventCategoryObject" on Source "MSExchangeSA\OAL Generator".
VERBOSE: Ending the task's processing.

3. Check the diagnostic logging level to make sure it has been changed. Type Get-EventLogLevel "MSExchangeSA\OAL Generator"

You will now see that the logging level has been set to Expert.

MSH>Get-EventLogLevel "MSExchangeSA\OAL Generator"
Identity : MSExchangeSA\OAL Generator
IsValid : True
ObjectState : Unchanged
Name : OAL Generator
Number : 13
EventLevel : Expert

How to rebuild an Offline Address List through the Microsoft Exchange Scripting Console


1. Type Update-OfflineAddressBook –Identity "Default Offline Address List"

NOTE: This will generate the Default Offline Address List. Again by default you will not see any output if the Offline Address List has been generates successfully.

OPTIONAL COMMNAD: You can also run Update-OfflineAddressBook –Identity "Default Offline Address List" -vb to output the information in verbose mode.

(verbose output)
VERBOSE: Beginning the task's processing.
VERBOSE: Processing one object in the task.
VERBOSE: Searching configurable objects "Default Offline Address List" of type "OfflineAddressBook" under the root "$null" on Source "DC1.fourthcoffee.com".
VERBOSE: Validating the configurable object "\Default Offline Address List".
VERBOSE: Searching configurable objects "E12-MBX" of type "Server" under the root "$null" on Source "DC1.fourthcoffee.com".
VERBOSE: Ending the task's processing.

 

How to display the Windows NT Application Event View information


At this point you have two options:
1. Open Windows NT Application Event Viewer and view the application log
2. Use the Microsoft Exchange Scripting Console to filter and dump out the events from the application log:

For this example I will use the Microsoft Exchange Scripting Console to do this task:
3. Type Get-EventLog Application | Where {$_.Category -eq "OAL Generator"} > c:\oabevents.txt

NOTE: This will pipe out all of the MSExchangeSA\OAL Generator events to the c:\oabevents.txt file in a truncated format. If you would like to see the entire text you can append | ft -Wrap to the end of the command to extend the text in a format table fashion.

Example: Get-EventLog Application | Where {$_.Category -eq "OAL Generator"} | ft -Wrap > c:\oabevents.txt

For this display I have truncated the event messages for display purposes.

1 comment: