Read Emails on Exchange server without OL client

  • Thread starter Thread starter Bryan Dickerson
  • Start date Start date
Add a reference to system.management

Kelly

P.S. dropped an email in your box you have listed for email
 
Already did that. Would posting a copy of my code help?
-----------------------------------------------------------------------
Dim search As New ManagementObjectSearcher("root\MicrosoftExchangeV2",
_
"SELECT * FROM Exchange_Mailbox WHERE
MailboxDisplayName = 'AR'")

Try
For Each objFound As ManagementObject In search.Get
txtStatus.AppendText("MailboxDisplayName: " &
objFound("MailboxDisplayName") & vbTab & _
"Size : " & objFound("Size") &
vbTab & _
"Total Items : " &
objFound("TotalItems") & vbNewLine)
Next
txtStatus.AppendText(vbNewLine & "Done.")
Catch ex As Exception
MsgBox("Error: " & ex.Message.ToString & " in " &
ex.Source.ToString)
End Try
 
Yes, I did add a reference to System.Management, but I'm still getting the
error. Is it a permissions error that I can't do a query like that against
the Active Directory? Or is Active Directory not even in this picture?
 
Nothing to do with Active Directory.

Sounds like you need to install WMI though with System. Management on there
you may hae already.

Do you have teh WMI SDK on your computer?
 
If I install the WMI SDK, would I have to install it on whatever box runs
this program? 'Cause this will eventually run on a server box.
 
Where would I download the WMI SDK, then? I Googled it and all I came up
with was links to an SDK that works for VC++ & VB6. Surely there's gotta be
an update since then.
 
Ok, I'm back to this. I tried one of the queries on this link:
http://www.wilsonmar.com/1wmiwbem.htm and am having limited success with it,
so I would guess that that means that I have the basics installed for using
WMI. So does the fact that I don't have administrator authority on the
network explain why I can't query the mail server?
 
Email me off list. I need to set up a remote desktop session with you. There
is no reason it should not be working.

Kelly
 
With all due respect, I'd prefer not to do that--I don't think my network
admin or my boss would think kindly of it.

I tried to bring up the WMI under Computer Management and all I see is a
window with the "i" balloon and the message: "Configures and Controls the
Windows Management Instrumentation (WMI) service." Does this information
help any? Is there anything else that I can check to see why I'm not able
to do this?
 
With all due respect, I'd prefer not to do that--I don't think my network
admin or my boss would think kindly of it.

the more I read of this thread I gotta wonder what you're up to over there
;)
 
Please go to services on the machine and verify "Windows Management
Instrumentation" is in fact running.
 
I apologize. Normally I am better at answering questions than this. Just
have had some road blocks.
 
I'm trying to write an email monitor for an internal email address that we
seem to be having problems with. So I'm just trying to do a simple read of
items in an inbox and report back if there are any unread items older than X
minutes. Kelly suggested using WMI and I am trying to get it to work, but
I'm getting an "Invalid Namespace" error when I try to run the code in his
reply. I think (or thought) it should be pretty simple stuff, but maybe I
thought wrong.
 
I'm running Windows XP Pro (with all the service packs and updates
installed) and I verified that the Windows Management Instrumentation
service is indeed running. There is a Windows Management Instrumentation
Driver Extensions that is not currently running and is listed as Manual.
Should that be running as well?
 
If I look at the WMI Control Properties, on the Security tab at the
Namespace navigation tree, there is no "MicrosoftExchangeV2" under the root
node. Does that tell you anything about what might be wrong? Is there
something that I need to add? If so, how? Is there something that I need
to be 'authorized' by my admin to see?
 
Back
Top