Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Set wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Security)}!\\" & hostName & "\root\cimv2")

$
0
0

Matthew Beattie,

I have recently seen your queryeventlogs.vbs cscript on the forum.

It uses a "moniker" argument for impersonationLevel I have not seen before, i.e (Security).

Using this resolved a problem I had with the Windows 7 Security event log; its contents being unauthorised to me, with:-


Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

but readable with:-

Set objWMIService = GetObject("winmgmts:" _

   & "{impersonationLevel=impersonate,(Security)}!\\" & strComputer & "\root\cimv2")

Previously, recommended solutions to the problem of adopting administrators authority or using wevtutil to authorise my profile access using its SSID did not work.

Can you please advise me what other (xxxxxxx) arguments are available for the "moniker" ?

Is there documentation for them and descriptions of their meaning?

For instance, I cannot access the Windows Setup event log file; to which I am apparently, unauthorised. Is their a

(xxxxxx) argument for that?

I tried:-

Set objWMIService = GetObject("winmgmts:" _

   & "{impersonationLevel=impersonate,(Setup)}!\\" & strComputer & "\root\cimv2")

but that does not work..

Thank you









Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>