| Author |
Message |
Guest
|
Posted:
Tue Sep 27, 2005 12:58 am Post subject:
Problem accessing Tracking Logs thru WMI |
|
|
Hello all.
I am new to WMI. I am confused as to why I am getting this Permissions
Denied error. This is a VBScript that returns Exchange Tracking Log
data. This script must run under LocalSystem.
----
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\ROOT\MicrosoftExchangeV2")
sqlSelect = "select MessageID, Size, SenderAddress, RecipientCount,
RecipientAddress, ServerName from Exchange_MessageTrackingEntry
set objEntries = objWMIService.ExecQuery(sql)
numberOfEntries = objEntries.Count
-----
I am not running this query remotely--it is local. This script runs
fine under a domain admin account, but fails under LocalSystem. I am
receiving a Permission Denied on the line that queries the collection
for the .Count property. It will also fail if I try to enumerate the
collection with a for each statement.
How come this fails with a Permission Denied? How come the Permission
Denied occurs when I try to access the collection (vs. running the
query)? What would I need to do to run this under LocalSystem?
Thanks!
|
|
| Back to top |
|
 |
Glen Scales [MVP]
Guest
|
Posted:
Tue Sep 27, 2005 6:33 am Post subject:
Re: Problem accessing Tracking Logs thru WMI |
|
|
To be able to query the WMI namespace in Exchange you need to have rights in
two places.
You first you need to have rights to the MicrosoftExchangeV2 namespace you
can check this by
In Computer Management under "Services and Applications" you have a "WMI
control" node if you right click this and select properties
Then select the security tab and then select the MicrosoftExchangeV2 node
and click security
Once they have rights to the namespace you also need at least
View-Only-Admin right in Exchange to be able to issue queries successfully.
Assigning such rights to the LocalSystem is not usually a good idea your
better of creating a user for this purpose and assign it just those rights.
Cheers
Glen
<pmaroun@gmail.com> wrote in message
news:1127773811.699896.292620@g49g2000cwa.googlegroups.com...
| Quote: | Hello all.
I am new to WMI. I am confused as to why I am getting this Permissions
Denied error. This is a VBScript that returns Exchange Tracking Log
data. This script must run under LocalSystem.
----
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\ROOT\MicrosoftExchangeV2")
sqlSelect = "select MessageID, Size, SenderAddress, RecipientCount,
RecipientAddress, ServerName from Exchange_MessageTrackingEntry
set objEntries = objWMIService.ExecQuery(sql)
numberOfEntries = objEntries.Count
-----
I am not running this query remotely--it is local. This script runs
fine under a domain admin account, but fails under LocalSystem. I am
receiving a Permission Denied on the line that queries the collection
for the .Count property. It will also fail if I try to enumerate the
collection with a for each statement.
How come this fails with a Permission Denied? How come the Permission
Denied occurs when I try to access the collection (vs. running the
query)? What would I need to do to run this under LocalSystem?
Thanks!
|
|
|
| Back to top |
|
 |
Pete
Guest
|
Posted:
Tue Sep 27, 2005 11:57 pm Post subject:
Re: Problem accessing Tracking Logs thru WMI |
|
|
Thanks Glen.
For the purposes of testing, I created a domain account, gave it access
to View-Only-Admin right in Exchange and specifically gave it
permissions to Root and Root/MicrosoftExchangeV2 WMI namespaces.
I still am having problems with the Permissions error. The only way to
get around this is to add the domain account to the local
Administrators group.
Any thoughts?
|
|
| Back to top |
|
 |
|
|
|
|