Lab 41 Using the Exchange_Mailbox Class

In this lab, you create a script that connects to the MicrosoftExchangeV2 namespace and queries the Exchange_Mailbox class.

Lab Instructions

  1. Open Notepad.exe.

  2. On the first line of a new file, type Option Explicit.

  3. Save your file as Lab41Solution.vbs.

  4. You need to declare six variables: strComputer, wmiNS, wmiQuery, objWMIService, colItems, and objItem. The completed Header information section of your script will look like the following:

    Option Explicit
    'On Error Resume Next
    Dim strComputer
    Dim wmiNS
    Dim wmiQuery
    Dim objWMIService
    Dim colItems
    Dim objItem
  5. Assign the variable strComputer to be equal to ".". This line of code will look like the following:

    strComputer = "."
  6. Assign the variable wmiNS to be equal to "

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.