Ошибка wmi seems to be not working

Любой бывалый Windows-админ периодически сталкивается с проблемами в работе службы WMI (Windows Management Instrumentation) и ее компонентах. Наличие проблем в подсистеме WMI является критичным с точки зрения нормального функционирования Windows, поэтому администратору необходимо проверить и восстановить работоспособность WMI. В этой статье мы опишем простую методику диагностирования и устранения неполадок службы WMI в Windows.

О наличии проблем с WMI может свидетельствовать широкий спектр ошибок:

  • Ошибки обработки WMI запросов в системных журналах и логах приложений (
    0x80041002 - WBEM_E_NOT_FOUND
    ,
    WMI: Not Found
    ,
    0x80041010 WBEM_E_INVALID_CLASS
    );
  • Ошибки обработки GPO, связанные на WMI ( некорректная работа wmi фильтров групповых политик, и пр.);
  • WMI запросы выполняются очень медленно;
  • Ошибки при установке или работе агентов SCCM/SCOM;
  • Ошибки в работе скриптов (vbs или PowerShell), использующих пространство имен WMI (скрипты с Get-WmiObject и т.д.).

Содержание:

  • Диагностика проблем с WMI
  • Исправление WMI репозитория, перерегистрация библиотек, перекомпиляция MOF файлов
  • Сброс и пересоздание WMI репозитория (хранилища)

Диагностика проблем с WMI

В первую очередь нужно проверить служба Windows Management Instrumentation (Winmgmt) установлена в Windows и запущена. Вы можете проверить состояние службы в консоли services.msc или с помощью PowerShell:

Get-Service Winmgmt | Select DisplayName,Status,ServiceName

служба Windows Management Instrumentation (Winmgmt) работает

Если служба Winmgmt запущена, вы можете проверить работоспособность WMI, обратившись к ней с помощью простого WMI-запроса. Вы можете выполнить wmi запрос из командной строки или из PowerShell. Например, следующая команда выведет список установленных в Windows программ:

wmic product get name,version

Простейшая PowerShell команда для получения информации о версии и билда Windows 10 через WMI может выглядеть так:

get-wmiobject Win32_OperatingSystem

powershell проверка работы wmi командой get-wmiobject

Как вы видите, служба WMI ответила на запрос корректно. Если при выполнении такого WMI-запроса Windows возвращает ошибку, скорее всего сервиса WMI работает некорректно, поврежден WMI репозиторий или есть какие-то другие проблемы.

ошибка Failed to initialize all required WMI classes

В моем случае, например, при открытии свойств WMI Control в консоли управления компьютером (compmgmt.msc) появлялась надпись:

Failed to initialize all required WMI classes
Win32_Processor. WMI: Invalid namespace
Win32_WMISetting. WMI: Invalid namespace
Win32_OperationSystem. WMI: Invalid namespace

Ранее для диагностики WMI существовала официальная утилита от Microsoft – WMIDiag.vbs (Microsoft WMI Diagnosis). WMIdiag это vbs скрипт, который проверяет различные подсистемы WMI и записывает собранную информацию в лог файлы (по умолчанию логи находятся в каталоге %TEMP% — C:USERS%USERNAME%APPDATALOCALTEMP). Получившийся отчет состоит из файлов, имена которых начинаются с WMIDIAG-V2.2 и включает в себя следующие типы фалов:

  • .log файлы содержат подробный отчет об активности и работе утилиты WMIDiag;
  • .txt файлы содержат итоговые отчеты о найденных ошибках, на которые стоит обратить внимание;
  • В .csv файлах содержится информация, нужная для долгосрочного анализа работы подсистемы WMI.

скрипт для исправления ошибок WMI WMIDiag.vbs

Совет. В 64 битных версиях Windows wmidiag нужно запускать так:

c:windowsSystem32cscript.exe wmidiag.vbs

в противном случае появится ошибка:

WMIDiag must be run from native 64-bit environment. It is not supported in Wow64.

WMIDiag It is not supported in Wow64

После окончания работы утилиты WMIDiag администратор должен изучить полученные файлы логов, проанализировать и попытаться исправить найденные ошибки.

К сожалению, последняя версия WMIDiag 2.2 корректно работает только с версиями до Windows 8.1/Windows Server 2012 R2. На данный момент Microsoft даже удалила ссылку на загрузку WMIDiag из Download Center. Но при желании, этот скрипт можно найти в сети.

WMIDiag может дать подробную информацию по исправлению частных ошибок в WMI, но в большинстве случаев процесс это довольно трудоемкий и стоит потраченного времени только при решении инцидентов в критичных системах (как правило, на продуктивных серверах). Для массового сегмента рабочих станций пользователей сбросить и пересоздатьWMI репозиторий в Windows.

Исправление WMI репозитория, перерегистрация библиотек, перекомпиляция MOF файлов

В Windows 10/Windows Server 2016 вы можете проверить целостность репозитория WMI с помощью команды:

winmgmt /verifyrepository

winmgmt-verifyrepository - проверка состояния репозитория wmi

Если команда возвращает, что база данных WMI находится в неконсистентном состоянии (INCONSISTENT или WMI repository verification failed), стоит попробовать выполнить “мягкое” исправление ошибок репозитория:

Winmgmt /salvagerepository

WMI repository has been salvaged.

Данная команда выполняет проверку согласованности хранилища WMI и при обнаружении несогласованности перестраивает базу данных WMI.

Перезапустите службу WMI:

net stop Winmgmt
net start Winmgmt

Если стандартный способ исправления ошибок в WMI не помог, попробуйте следующий скрипт. Данный скрипт представляет собой ”мягкий” вариант восстановления службы WMI на компьютере (выполняется перерегистрация dll библиотек и службы WMI, перекомпилируются mof файлы). Данная процедура является безопасной и ее выполнение не должно привести к каким-либо новым проблемам с системой.

sc config winmgmt start= disabled
net stop winmgmt
cd %windir%system32wbem
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
wmiprvse /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %s in ('dir /b *.mof') do mofcomp %s
for /f %s in ('dir /b *.mfl') do mofcomp %s

На 64 битной версии Windows эти действия нужно также выполнить для каталога SysWOW64. Замените третью строку на

cd %windir%SysWOW64wbem

bat скрипт для перерегистрации компонентов wmi

Указанные команды можно выполнить путем простой вставки в окно командой строки, либо сохранить код в bat файле wmi_soft_repair.bat и запустить его с правами администратора. После окончания работы скрипта, перезагрузите Windows и проверьте работу WMI.

Сброс и пересоздание WMI репозитория (хранилища)

Если вам не помогли мягкие способ восстановления WMI, рассмотренные выше, придется перейти к более “жесткому” способу восстановления работоспособности службы WMI, заключающегося в пересоздании хранилищаWMI.

WMI репозиторий (хранилище) находится в каталоге
%windir%System32WbemRepository
и представляет собой базу данных, в которой содержится информация о метаданных и определениях WMI классов. В некоторых случаях WMI репозиторий может содержать статическую информацию классов. При повреждении репозитория WMI, в работе службы Windows Management Instrumentation (Winmgmt) могут наблюдаться ошибки вплоть до полной невозможности ее запустить.

Если вы подозреваете, что репозиторий WMI поврежден, имейте в виду, что его пересоздание — это последняя шаг, к которому нужно прибегнуть только тогда, когда другие операции не помогают реанимировать WMI.

Следующая команда выполнит сброс базы данных WMI к исходному состоянию (как после чистой установки Windows). Используйте эту команду для выполнения hard reset репозитория WMI, если параметре salvagerepository не исправил проблему:

Winmgmt /resetrepository

Совет. На практике бывают случаи, когда пересоздание хранилища WMI приводит к проблемам со сторонним софтом. Это связано с тем, что все записи в базе WMI обнуляются (до состояния чистой системы). Такие программы скорее всего, придется переустанавливать в режиме восстановления.

Если обе команды (
Winmgmt /salvagerepository
и
Winmgmt /resetrepository
) не восстановили консистентное состояние базы WMI, попробуйте выполнить “жесткое” пересоздание базы WMI вручную таким скриптом:

sc config winmgmt start= disabled
net stop winmgmt
cd %windir%system32wbem
winmgmt /resetrepository
winmgmt /resyncperf
if exist Repos_bakup rd Repos_bakup /s /q
rename Repository Repos_bakup
regsvr32 /s %systemroot%system32scecli.dll
regsvr32 /s %systemroot%system32userenv.dll
for /f %s in ('dir /b *.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
sc config winmgmt start= auto
net start winmgmt
wmiprvse /regserver

сброс и восстановление хранилища wmi в windows 10

На 64 битной версии Windows нужно также перерегистрировать dll/exe и перекомпилировать mof файлы в каталоге %windir%sysWOW64wbem.

Данный скрипт полностью пересоздает хранилище WMI (старый репозиторий сохраняется в каталог Repos_bakup). После окончания работы скрипта нужно перезагрузить Windows. Затем протестируйте работу службы WMI простым запросом.

Проверьте состояние WMI репозитория. Если ошибки исправлены, команда
winmgmt /verifyrepository
должна вернуть:

WMI repository is consistent

WMI repository is consistent

В этой статье мы собрали основные способы, позволяющие продиагностировать и устранить неполадки службы и репозитория WMI.

Wmi windows management instrumentation seems to be not working

А в чем выражается проблема с WMI?
Стим может не работать совсем по другим причинам, например, присутствие прокси, закрытые порты, etc. В виртуалке игры от стима вряд ли запустятся.

А самое главное, что такое WMI ? Может VMWARE ?

Тогда нужно было публиковать это сообщение в другом разделе, этот же для виртуальных машин.

Для восстановления WMI можно выполнить нижеследующие пункты, но вообще неплохо бы сообщить подробности о проблеме, коды ошибок, что в логах и прочее.
Это поможет локализовать ошибку и найти верное решение.

1) пуск Выполнить ввести команду SFC /SCANNOW

To fix this problem:
1. Use the Start menu to right-click My Computer.
2. Press the Manage item.
3. Double-click Services and Applications in the left-hand pane.
4. Press Services to expand it.
5. Scroll to Windows Management Instrumentation in the right-hand pane and
right-click it.
6. Press Stop.
7. Use Windows Explorer to delete all the files in the
%SystemRoot%System32WbemRepository folder.
8. Shutdown and restart your computer. The Windows Management
Instrumentation service will start and the files will be re-created.]]

Go to Start/Run/CMD and then run each of these hitting Enter after each:

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

This may or may not repair the repository but will re-install wmi into the
registry.]

To correct permission issues:

1 — In the Management ConsoleServices STOP WMI and set to manual.
2 — Go to the WMI repository %Windows%system32%wbem and delete the
repository.
3 -Set the WMI service back to Automatic
4 — From %Windows%system32%wbem run «wbemtest» and connect to your
namespace.
5 — Start/Run/Regedit and navigate to: Locate current

HKEY_CURRENT_CONFIGSystemCurrentControlSetControlClass. Open the class
key and right click on the sub key 0000 and select permissions and make sure
that the permissions for you [administrator] are «Full».

3) Устранение неполадок с инструментарием WMI в Windows XP с пакетом обновления 2 (SP2) http://support.microsoft.com/kb/875605/ru

4) Переустановить windows в режиме обновления.

помогитие востоновить или чтонибуть(( 🙁 🙁

вот какая ошибка http://www.valar.ru/upload/jpg/1208/1230449161_.htm внутри http://www.valar.ru/upload/jpg/1208/1230450446_1.htm

Процессор:
Поставщик: GenuineIntel
Скорость: 2507 МГц
Логические процессоры 2
Физические процессоры 2
HyperThreading: Не поддерживается
FCMOV: Поддерживается
SSE2: Поддерживается

Сеть:
Скорость сети:

Версия Windows:
Windows XP (32 бит)
NTFS: Поддерживается

Видеокарта:
Драйвер не найден
Драйвер DirectX: nv4_disp.dll
Версия драйвера не установлена
Версия драйвера DirectX: 6.14.11.7531
Дата выпуска не установлена
Карта DirectX: NVIDIA GeForce 9800 GT
ID продавца: 0x10de
ID карты: 0x605
Кол-во экранов: 1
Количество логических видеокарт: 1
SLI или Crossfire не обнаружено
Разрешение осн. экрана: 1024 x 768
Разрешение Рабочего стола: 1024 x 768
Размер осн. экрана: 11.81″ x 8.86″ (14.76″ diag)

30.0cm x 22.5cm (37.5cm diag)
Осн. шина: PCI Express 16x
Осн. видеопамять: 512 MB
Поддерживаемое сглаживание: 2x 4x 8x

Звуковая карта:
Аудио устройство: SoundMAX HD Audio

Память:
Оперативная память: 2047 МБ

Разное:
Язык интерфейса: Русский
Микрофон: Not set
Тип носителя: DVD
Места на диске: 305242 Мб
Наиболее свободный диск: 143837 Мб
Дата установки операционной системы: 27 2008
Установлено пакетов:

меня послали суда я точно незнаю вы помогите мне пожалусто))буду очень блогодаренНедавно решал именно эту проблему, решение было очень неожиданным 🙂

Сразу сообщаю, что решение в итоге было включение группы NetworkService в группу Администраторов. При этом у человека всё работало до того как довольно долго.

Недавно решал именно эту проблему, решение было очень неожиданным

Сразу сообщаю, что решение в итоге было включение группы NetworkService в группу Администраторов. При этом у человека всё работало до того как довольно долго.
ну помоги как вы решили проблем

помогите пожалусто!мнее то непомогло опять тажа ошибка

NoNone
помоги плизз

да я зделал это и просканировал последним касперским

Продолжу в этой ветке, так как проблема немного похожа:

При прогоне wmidiag.vbs получаю сообщения об отсутсвии ряда классов в пространстве имен Root/cimv32

17501 16:32:27 (0) ** — Root/CIMv2, Win32_PerfRawData_Tcpip_IP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17502 16:32:27 (0) ** MOF Registration: ‘No located MOF file (exception)’
17503 16:32:27 (0) ** — Root/CIMv2, Win32_PerfRawData_Tcpip_TCP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17504 16:32:27 (0) ** MOF Registration: ‘No located MOF file (exception)’
17505 16:32:27 (0) ** — Root/CIMv2, Win32_PerfRawData_Tcpip_UDP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17506 16:32:27 (0) ** MOF Registration: ‘No located MOF file (exception)’
17507 16:32:27 (0) ** — Root/CIMv2, Win32_PerfRawData_Tcpip_ICMP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17508 16:32:27 (0) ** MOF Registration: ‘No located MOF file (exception)’
17509 16:32:27 (0) ** — Root/CIMv2, Win32_PerfFormattedData_Tcpip_IP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17510 16:32:27 (0) ** MOF Registration: ‘C:WINDOWSSYSTEM32WBEMWMI.MOF’
17511 16:32:27 (0) ** — Root/CIMv2, Win32_PerfFormattedData_Tcpip_TCP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17512 16:32:27 (0) ** MOF Registration: ‘C:WINDOWSSYSTEM32WBEMWMI.MOF’
17513 16:32:27 (0) ** — Root/CIMv2, Win32_PerfFormattedData_Tcpip_UDP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17514 16:32:27 (0) ** MOF Registration: ‘C:WINDOWSSYSTEM32WBEMWMI.MOF’
17515 16:32:27 (0) ** — Root/CIMv2, Win32_PerfFormattedData_Tcpip_ICMP, 0x80041002 — (WBEM_E_NOT_FOUND) Object cannot be found.
17516 16:32:27 (0) ** MOF Registration: ‘C:WINDOWSSYSTEM32WBEMWMI.MOF’

Удивительным образом все 8 связаны с TCP. Счетчики производительности для службы tcpip в реестре отсутствуют. А вот как их туда загрузить с помощью команды lodctr ? Какой ini файл для счетчиков драйвера TCP? И что значит No located MOF file (exception) — какой MOF компилировать?

Источник

WMI Проблемы и решения

Не раз я сталкивался, что перестают у пользователя запускаться службы (хотя он является локальным админом), ну или например перестает работать SMS агент (Перестает обмениваться с SCCM).

Я очень долго пытался с этим разобраться и наконец разобрался .

Проблема кроется в злостном WMI. Давайте для начала попробуем разобраться что же это такое и с чем его есть? Всеми любимая, а также очень умная девочка Вика Wikipedia сообщает:

WMI (Windows Management Instrumentation в дословном переводе) — это инструментарий управления Windows. Если говорить более развернуто, то WMI — это одна из базовых технологий для централизованного управления и слежения за работой различных частей компьютерной инфраструктуры под управлением платформы Windows.

Опа. За нами следит большой брат .

Самое простое что можно сделать это пересобрать WMI как правило это решает большую часть проблем.

Для Выполнения этих задач нам потребуется запустить командную строку от администратора (Пуск выполнить CMD) или пользователя который будет состоять в группе Локальных администраторов и выполнить следующее:

cd /d %windir%system32wbem

REM Перерегистрируем компоненты

for %i in (*.dll) do RegSvr32 -s %i

for %i in (*.exe) do %i /RegServer

По идее этого должно быть достаточно но лишнем не будет выполнить и следующее:

Ну и напоследок перекомпиляция mof файлов

for /r %i in (*.mof *.mfl) do mofcomp %i

При устранении неисправностей следуйте простому правилу: сначала пробуйте решить проблему менее «жестким» способом (перерегистрацией библиотек и перекомпиляцией mof-файлов) и только если ничего не помогает – перестройкой (удалением и созданием заново) репозитория.

Это связано с тем, что существуют приложения, которые только обновляют репозиторий при установке, но не используют .mof-файлы. Соответственно, при удалении и создании заново репозитория данные приложения не обновят информацию автоматически и не все их данные, связанные с WMI, будут потеряны вплоть до того момента, пока вы не переустановите эти приложения.

Так же следует помнить, что не все приложения хранят свои библиотеки и .mof-файлы в %systemroot%system32wbem. Соответственно вам нужно будет их найти перед тем как зарегистрировать библиотеки заново или перекомпилировать mof.

Собрались на рыбалку? вот Вам отличная донная снасть спешите!

Источник

WMI Troubleshooting

When accessing WMI local or remote data in an application or script, you may encounter errors ranging from missing classes to access denied. Providers also have debugging options and troubleshooting classes available.

The following documentation is targeted for developers and IT administrators. If you are an end-user that has experienced an error message concerning WMI, you should go to Microsoft Support and search for the error code you see on the error message. For more information about troubleshooting problems with WMI scripts and the WMI service, see WMI Isn’t Working!

WMI Diagnosis Utility

The WMI diagnosis Utility (WMIDiag.exe) is no longer supported starting with Windows 8 and Windows Server 2012.

**Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: **

If WMI returns error messages, be aware that they may not indicate problems in the WMI service or in WMI providers. Failures can originate in other parts of the operating system and emerge as errors through WMI. Under any circumstances, do not delete the WMI repository as a first action because deleting the repository can cause damage to the system or to installed applications.

To obtain more information about the source of the problem, you can download and run the WMI Diagnosis Utility diagnostic command line tool. This tool produces a report that can usually isolate the source of the problem and provide instructions on how to fix it. The report also aids Microsoft support services in assisting you. You can download the WMI Diagnosis Utility at the Download Center.

Provider writers may also encounter debugging issues unless you are writing a decoupled provider. For more information, see Debugging Providers.

Logging and Tracing

The WMI log files no longer exist; they were replaced by Event Tracing for Windows (ETW). For more information, see Tracing WMI Activity, Logging WMI Activity, and WMI Log Files.

Troubleshooting in Scripts and Applications

WMI contains a set of classes for troubleshooting client applications that use WMI providers. For more information, see Troubleshooting WMI Client Applications.

How Provider Writers Can Prevent WMI Problems

Provider writers can prevent many problems, which appear in error messages through WMI, by performing the following actions:

  • Registering your provider correctly. For more information, see Registering a Provider.
  • Adding the #pragma autorecover statement to the Managed Object Format (MOF) file that defines your provider classes.

Access Denied

Access Denied errors that are reported by scripts and applications that access WMI namespaces and data generally fall into three categories. The following table lists the three categories of errors along with issues that might cause the errors and possible solutions.

Error Possible Issues Solution
0x800706BA HRESULT_FROM_WIN32(RPC_S_SERVER_UNAVAILABLE)
Firewall issue or server not available.
The computer really doesn’t exist The Windows Firewall is blocking the connection Connecting to Vista: netsh advfirewall firewall set rule group=»windows management instrumentation (wmi)» new enable=yes Connecting to downlevel: Allow the «Remote Administration» rule in Windows Firewall.
0x80070005 E_ACCESS_DENIED
Access denied by DCOM security.
The user does not have remote access to the computer through DCOM. Typically, DCOM errors occur when connecting to a remote computer with a different operating system version. Give the user Remote Launch and Remote Activation permissions in dcomcnfg. Right-click My Computer-> Properties. Under COM Security, click «Edit Limits» for both sections. Give the user you want remote access, remote launch, and remote activation. Then go to DCOM Config, find «Windows Management Instrumentation», and give the user you want Remote Launch and Remote Activation. For more information, see Connecting Between Different Operating Systems
0x80041003 WBEM_E_ACCESS_DENIED
Access denied by a provider
The user does not have permission to perform the operation in WMI. This could happen when you query certain classes as a low-rights user, but most often happens when you attempt to invoke methods or change WMI instances as a low rights user. The namespace you are connecting to is encrypted, and the user is attempting to connect with an unencrypted connection Give the user access with the WMI Control (make sure they have Remote_Access set to true) Connect using a client that supports encryption.

Typically, DCOM errors occur when connecting to a remote computer with a different operating system version.

Providers may also deny access to data in specific namespaces or may require certain levels of connection security. For more information, see Setting Client Application Process Security and Provider Hosting and Security.

Access denied errors from Internet Connection Firewall (ICF) changes.

An access denied error is returned by DCOM security when a low-integrity client tries to access WMI. For example, an ActiveX control that is running in Internet Explorer, which has the security level set to low, does not have access to perform local WMI operations.

Windows 7: Low-integrity users have read-only permissions for local WMI operations.

Information on Errors

When you get an error message from WMI, you can locate the message in WMI Error Constants or, for scripting, WbemErrorEnum. However, the information supplied by the error alone is typically insufficient to determine what is happening. WMI repository corruption may masquerade as classes or instances «not found».

For more information about WMI errors:

  • The WMI logs track events from within the WMI core and from providers. For more information, see Logging WMI Activity.
  • Use the WMI Troubleshooting Classes to check WMI internal status or receive notifications of provider or WMI service events. For more information, see Provider Configuration and Troubleshooting Classes and Troubleshooting WMI Client Applications.

Источник

  • Remove From My Forums
  • Question

  • The ConfigMgr agent stopped working on a Windows 2008 R2 Domain Controller. I uninstalled the agent and found I cannot reinstall the agent. I find errors like the below.

    —> Unable to get Win32_OperatingSystem object from WMI on remote machine «DC», error = 0x80041010.
    SMS_CLIENT_CONFIG_MANAGER      12/4/2014 2:40:31 PM        
    4980 (0x1374)

    Execute query exec [sp_CP_SetLastErrorCode] 16777234, -2147217392           
    SMS_CLIENT_CONFIG_MANAGER      12/4/2014 2:40:31 PM        
    4980 (0x1374)

    It seems WMI is not working. My usually fix for rebuilding WMI does not seem to work. Any ideas?

Answers

  • I forgot about running mofcomp for all the mof files. That fixed WMI. I used the for command to find and run mofcomp.

    • Marked as answer by

      Tuesday, December 16, 2014 5:32 PM

Часто Репозиторий WMI поврежден, что приводит к сбою загрузки поставщика. В этом руководстве мы расскажем, как восстановить или перестроить репозиторий WMI в Windows 10. Для тех, кто не в курсе, инструментарий управления Windows или WMI представляет собой набор спецификаций Microsoft для консолидации управления устройства и приложения в сети. Это база данных, в которой хранится метаинформация и определения для классов WMI . Только используя их, условия систем могут быть известны.

Репозиторий доступен здесь –

% WINDIR% system32 Wbem Repository

Вкратце, он предоставляет конечным пользователям статус локальной или удаленной компьютерной системы.

Примечание . Не используйте это на компьютере с кластером Server 2012

Содержание

  1. Восстановить или перестроить репозиторий WMI в Windows
  2. 1] Сбросить WMI Repository
  3. 2] Принудительное восстановление WMI
  4. WMI Самовосстановление не работает
  5. 3] WMI Fixer Tool

Восстановить или перестроить репозиторий WMI в Windows

Существуют инструменты командной строки для исправления или восстановления хранилища WMI. Тем не менее, Microsoft предполагает, что лучше всего проверить, есть ли коррупция.

Ниже приведен список ошибок и проблем с разрешениями, которые вы можете увидеть:

  1. Невозможно подключиться к корневым пространствам имен по умолчанию или rootcimv2. Сбой с кодом ошибки «0x80041002», указывающим на «WBEM_E_NOT_FOUND».
  2. Когда вы открываете «Управление компьютером» и щелкаете правой кнопкой мыши пункт «Управление компьютером» (локальное) и выбираете «Свойства», появляется следующее сообщение об ошибке: «WMI: не найден» или зависание при попытке подключения
  3. 0x80041010 WBEM_E_INVALID_CLASS
  4. Попытка использовать wbemtest , и он зависает
  5. Схемы/Объекты отсутствуют
  6. Странные ошибки подключения/работы (0x8007054e).

Лучший способ проверить это – запустить эту команду в командной строке с повышенными правами.

 winmgmt/verifyrepository 

Если в хранилище есть проблема, он ответит « хранилище не согласовано », если нет, то это что-то другое, что вызвало проблему. Теперь, когда вы уверены, что коррупция существует, давайте следуем этим советам, чтобы восстановить или перестроить репозиторий WMI.

1] Сбросить WMI Repository

Откройте командную строку с повышенными привилегиями.

Запустите команду:

 winmmgmt/salvagerepository 

Затем выполните команду, чтобы увидеть, вернется ли она как

 winmgmt/verifyrepository 

Если говорится, что Репозиторий не согласован , вам нужно выполнить:

 winmgmt/resetrepository 

Это поможет вам исправить хранилище WMI. Вот что означает каждая из команд WMI:

  • salvagerepository: этот параметр при использовании с командой winmmgmt выполняет проверку согласованности. Если обнаружено несоответствие, он восстанавливает хранилище.
  • verifyrepository: выполняет проверку непротиворечивости в WMI-хранилище.
  • resetrepository: репозиторий сбрасывается в исходное состояние при первой установке операционной системы

Надеюсь, что это объясняет, что происходит, когда вы выполняете команды.

2] Принудительное восстановление WMI

WMI поставляется со встроенным процессом самовосстановления. Когда служба WMI перезапускается или обнаруживает любое повреждение, процедура самовосстановления запускается автоматически. Это происходит двумя способами:

Автообновление : Здесь будут использоваться образы резервных копий, если включена резервная копия VSS (теневое копирование тома).

Автообновление : . В этом процессе перестройки будут генерироваться свежие образы репозитория на основе зарегистрированных MOF. MOFS доступна в реестре здесь:

HKLM Software Microsoft WBEM CIMOM: автоматическое восстановление MOF

Примечание. Автоматическое восстановление MOF является ключевым моментом. Дважды щелкните по нему, чтобы проверить значение.

WMI Самовосстановление не работает

Если самовосстановление не работает, вы всегда можете воспользоваться процессом принудительного восстановления.

Проверьте значение regkey пусто или не здесь:

HKLM Software Microsoft WBEM CIMOM Авто-восстановление MOF

Если приведенный выше ключ пуст, скопируйте и вставьте значение ключа с другого компьютера. Убедитесь, что это из системы, которая эквивалентна рассматриваемому компьютеру.

Далее выполните команду

 Winmgmt/resetrepository 

Если вы получили сообщение об ошибке «Сброс хранилища WMI не выполнен. Код ошибки: 0x8007041B. Facility: Win32 ”, затем остановите все Dependency Services в службе WMI, выполнив следующие команды:

 net stop winmgmt/y
Winmgmt/resetrepository 

Если оба предложенных исправления не работают, самое время попробовать автоматизированный инструмент.

3] WMI Fixer Tool

Этот инструмент исправит серверный WMI-репозиторий, если он поврежден или возникла связанная с ним проблема. Вы можете скачать WMI Fixer Tool от Technet.

Связанное чтение . WMI вызывает высокую загрузку ЦП.

Every experienced Windows administrator has faced some issues with the WMI service (Windows Management Instrumentation) and its components. The problems in WMI subsystem are critical for the normal operation of Windows, therefore the administrator needs to check and restore the functionality of WMI as soon as possible. In this article we’ll describe quite a simple technique of troubleshooting and fixing WMI problems on Windows 10 and Windows Server 2016/2019.

A problem with the WMI may indicate a wide range of errors:

  • The errors on the WMI queries processing in the system and application logs (0x80041002 - WBEM_E_NOT_FOUND, WMI: Not Found, 0x80041010 WBEM_E_INVALID_CLASS);
  • GPO processing errors related with WMI (incorrect work of the WMI-filters of Group  Policies, etc.);
  • WMI queries are very slow;
  • Errors during installation or operation of SCCM/SCOM agents;
  • Errors in scripts (VBS or PowerShell) that use the WMI namespace (scripts with Get-WmiObject, etc.)

Contents:

  • Troubleshooting WMI Problems
  • Repairing the WMI Repository and Recompiling MOF Files
  • Rebuilding the WMI Repository

Troubleshooting WMI Problems

The first step is to check the Windows Management Instrumentation (Winmgmt) service is installed on Windows and running. You can check the status of the service in the services.msc console or using PowerShell:

Get-Service Winmgmt | Select DisplayName,Status,ServiceName

check that the Winmgmt service (Windows Management Instrumentation) is running

If the Winmgmt service is running, you can test the health of WMI by quering it with a simple WMI command. You can execute wmi request from command prompt or from PowerShell. For example, the following command will list the programs installed on Windows:

wmic product get name,version

The simplest PowerShell command to get information about the version and build of Windows 10 via WMI might look like this:

get-wmiobject Win32_OperatingSystem

test wmi using powershell cmdlet get-wmiobject

As you can see, the WMI service responded to the request correctly. If Windows returns an error when executing such a WMI query, most likely the WMI service is not working correctly, the WMI repository is damaged, or there are other problems.

wmi error: Failed to initialize all required WMI classes Invalid namespace

In my case, for example, when opening the WMI Control properties in the Computer Management snap-in (compmgmt.msc), the following message appeared:

Failed to initialize all required WMI classes
Win32_Processor. WMI: Invalid namespace
Win32_WMISetting. WMI: Invalid namespace
Win32_OperationSystem. WMI: Invalid namespace

Previously, the official Microsoft tool WMIDiag.vbs (Microsoft WMI Diagnosis) was used to diagnose WMI. WMIdiag is a vbs script that checks various WMI subsystems and writes the collected information to the log files (by default the logs are located in %TEMP% folder – C:USERS%USERNAME%APPDATALOCALTEMP). The resulting report consists of files with names starting with WMIDIAG-V2.2 and includes the following file types:

  • LOG files contain a detailed report report on the activity and operation of the WMIDiag tool;
  • TXT files contain the summary reports of found errors that are worth paying attention;
  • CSV files contain information necessary for a long-term analysis of the WMI performance.

wmidiag.vbs version 2.2 - script to troubleshoot wmi errors

Tip. In Windows x64 versions wmidiag should be run as follows:
c:windowsSystem32cscript.exe wmidiag.vbs
otherwise, there occurs an error:

WMIDiag must be run from native 64-bit environment. It is not supported in Wow64.

WMIDiag must be run from native 64-bit environment. It is not supported in Wow64

After WMIDiag has completed its task, the administrator should examine the log files, analyse and try to fix the found errors.

Unfortunately, the latest version of WMIDiag 2.2 works correctly only with versions up to Windows 8.1/Windows Server 2012 R2. At this point, Microsoft has even removed the link to download WMIDiag from the Download Center. But if you wish, this script can be found on the web.

WMIDiag provide detailed information on how to correct local errors in WMI, but in most cases it is a time-consuming task and is worth of the time spent only when looking for solutions to the problems in the critical systems (usually on the production servers). In case of the user workstations, it is much easier to reset and rebuild the WMI repository in Windows.

Repairing the WMI Repository and Recompiling MOF Files

On Windows 10/Windows Server 2016, you can check the integrity of the WMI repository using the command:

winmgmt /verifyrepository

winmgmt /verifyrepository

If the command returns that the WMI database is in an inconsistent state (INCONSISTENT or WMI repository verification failed), you should try doing a soft fix of WMI repository errors:

Winmgmt /salvagerepository

WMI repository has been salvaged.

This command checks the consistency of the WMI repository and rebuilds the WMI database if inconsistencies are found.

Restart the WMI service:

net stop Winmgmt
net start Winmgmt

If the standard WMI fix doesn’t work, try the following script. This script is a “soft” option for recovering the WMI service on the computer (the DLL libraries and WMI are re-registered and MOF files are recompiled). This procedure is safe and its implementation should not cause any more problems with the operating system:

sc config winmgmt start= disabled
net stop winmgmt
cd %windir%system32wbem
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
wmiprvse /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %s in ('dir /b *.mof') do mofcomp %s
for /f %s in ('dir /b *.mfl') do mofcomp %s

On a 64-bit version of Windows, these steps must also be performed for the SysWOW64 directory. Replace the third line with:

cd %windir%SysWOW64wbem

batch script to perform soft reset of the wmi service on windows 10

These commands can be run by simply pasting them into the command prompt, or you can save the script as a BAT file (wmi_soft_repair.bat) and run it with the administrator permissions. After the script finishes, restart Windows and check if WMI is working.

Rebuilding the WMI Repository

If the method described above has not helped, use more “hard” way of the WMI recovery that implies the recreation of the WMI repository.

The WMI repository is located in %windir%System32WbemRepository and is a database that contains information on the metadata and definitions of the WMI classes. In some cases the WMI repository can also contain static class information. When the repository is damaged, errors occur in the activity of WMI service (Winmgmt).

If you suspect that the WMI repository is damaged, keep in mind that it only should be recreated if no other means to restore WMI are effective.

The following command will reset the WMI database to its original state (as after a clean Windows install). Use this command to hard reset the WMI repository if the salvagerepository parameter didn’t fix the problem:

Winmgmt /resetrepository

Tip. In practice, there are cases, when the rebuilding of WMI repository causes problems with the third-party software. The reason is that all records in the WMI database are cleared (to the state of a clean system). Such software may have to reinstall in recovery mode.

If both commands (Winmgmt /salvagerepository and Winmgmt /resetrepository) didn’t restore the consistent state of the WMI database, try to perform a hard reset of the WMI database with the following script:

sc config winmgmt start= disabled
sc config winmgmt start= disabled
net stop winmgmt
cd %windir%system32wbem
winmgmt /resetrepository
winmgmt /resyncperf
if exist Repos_bakup rd Repos_bakup /s /q
rename Repository Repos_bakup
regsvr32 /s %systemroot%system32scecli.dll
regsvr32 /s %systemroot%system32userenv.dll
for /f %s in ('dir /b *.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
sc config winmgmt start= auto
net start winmgmt
wmiprvse /regserver

bat script to repair or rebuild the WMI Repository on Windows 10

On 64-bit version of Windows, you also need to re-register the DLL/EXE and recompile the MOF files in the %windir%sysWOW64wbem directory.

This script completely removes and recreates the WMI repository folder (the old repository is saved to the Repos_backup directory). After the script has completed, you need to restart Windows. Then check the WMI service with a simple query.

Check the WMI repository state. If the errors are fixed, the winmgmt /verifyrepository command should return:

WMI repository is consistent

winmgmt /verifyrepository WMI repository is consistent

In this article, we have showed basic ways to diagnose and troubleshoot the WMI service and repository.

Понравилась статья? Поделить с друзьями:
  • Ошибка wmi event filter with query select from instancemodificationevent
  • Ошибка wlan module id 702 hp
  • Ошибка wipe data factory reset
  • Ошибка winword exe 0xc0000142 при запуске word
  • Ошибка winter на шевроле эпика