WMI权限问题:Access is denied, please check whether the [domain-username-password] ..

冯皓
2023-12-01

错误信息:

org.jinterop.dcom.common.JIException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions.  [0x00000005]
at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:197)
at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:131)
at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:162)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:413)
at com.feng.test.MavenTest.AppTest.connect(AppTest.java:90)
at com.feng.test.MavenTest.AppTest.main(AppTest.java:136)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions.  [0x00000005]
at org.jinterop.winreg.IJIWinReg$openKey.read(IJIWinReg.java:939)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:191)
... 5 more
解决方法:

Access is denied error

When you get an

"Access is denied. [0x00000005]"
error, apply the following patch to the registry:

 

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • create or modify 32-bit DWORD: LocalAccountTokenFilterPolicy
  • set the value to: 1

Credit to Arturas Sirvinskas (comments below)

 

参考:https://wiki.jenkins-ci.org/display/JENKINS/Windows+slaves+fail+to+start+via+DCOM

 类似资料: