none
Permissions required to run: ExecNotificationQueryAsync RRS feed

  • Question

  • I was directed to this section via: https://social.microsoft.com/Forums/en-US/3095c554-7606-4164-be06-81065c8db968/vbscript-forum?forum=whatforum

    This is a VBScript program that is failing to run an an unprivileged user via Task Scheduler. I'm trying to get the following bit of code to work on a Windows Server 2016 Domain Controller:

    Set objWMIServiceRoot = GetObject("WinMgmts:\\.\root\cimv2")
    Set objSink = WScript.CreateObject("WbemScripting.SWbemSink","objSink_")
    	objWMIServiceRoot.ExecNotificationQueryAsync objSink, "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'"

    It fails at:

    ExecNotificationQueryAsync

    With the error:
    -2147217400
    Invalid parameter

    This works fine when I run the task as an administrator but I do not want the program to have administrative rights.

    Any suggestions?
    Thanks!

    Thursday, November 9, 2017 2:05 PM

All replies