WMI Query Script as a Job

后端 未结 3 928
刺人心
刺人心 2021-01-16 06:16

I have two scripts. One calls the other with a list of servers as parameters. The second query is designed to execute a WMI query. When I run it manually, it does this perfe

3条回答
  •  孤街浪徒
    2021-01-16 06:27

    This is one instance I could find. http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/a6c816dd-2c2c-47bc-a2d0-238fbb9d66a6

    There are many other discussions I have seen around the same.

    Anyway, to make sure your WMI respository isn't corrupt, just try re-compiling it. Put the following lines in a batch file and run:

    net stop winmgmt
    c:
    cd c:\windows\system32\wbem
    rd /S /Q repository
    regsvr32 /s %systemroot%\system32\scecli.dll
    regsvr32 /s %systemroot%\system32\userenv.dll
    mofcomp cimwin32.mof
    mofcomp cimwin32.mfl
    mofcomp rsop.mof
    mofcomp rsop.mfl
    for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
    for /f %%s in ('dir /b *.mof') do mofcomp %%s
    for /f %%s in ('dir /b *.mfl') do mofcomp %%s
    mofcomp exwmi.mof
    mofcomp -n:root\cimv2\applications\exchange wbemcons.mof
    mofcomp -n:root\cimv2\applications\exchange smtpcons.mof
    mofcomp exmgmt.mof
    

提交回复
热议问题