Accessing Win 2008 Server R2 - Access Denied

kurt
2010-06-10
2012-11-29
  • kurt

    kurt - 2010-06-10

    Hi all,

    I know this question has been asked a lot but I still cannot figure out how to successfully connect to our remote Windows 2008 R2 Server using J-Interop. Ther server is in the same domain as my client and I can run the MSWMI2 example successfully locally on my laptop but not on the remote server (funny thing is, that the first MSWMI example doesn't work on my local machine either, it can login but then it gives me a element not found exception). I'm member of the administrators group on that remote server and the windows firewall is disabled.

    When I set autoregistration to false, I get:

    org.jinterop.dcom.common.JIException: Class not registered. If you are using a DLL/OCX , please make sure it has "DllSurrogate" flag set. Faq A(6) in readme.html.
    at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:580)
    at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:481)
    at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:414)
    at mainpackage.MSWMI2.<init>(MSWMI2.java:43)
    at mainpackage.MSWMI2.main(MSWMI2.java:116)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Class not registered. If you are using a DLL/OCX , please make sure it has "DllSurrogate" flag set. Faq A(6) in readme.html.
    at org.jinterop.dcom.core.JIRemActivation.read(JIRemActivation.java:192)
    at ndr.NdrObject.decode(NdrObject.java:36)
    at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
    at rpc.Stub.call(Stub.java:113)
    at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:568)

    When I set autoregistration to true, I get:
    org.jinterop.dcom.common.JIException: Access is denied, please check whether the  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. 
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_CreateKey(JIWinRegStub.java:310)
    at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:510)
    at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:414)
    at mainpackage.MSWMI2.<init>(MSWMI2.java:43)
    at mainpackage.MSWMI2.main(MSWMI2.java:116)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied, please check whether the  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. 
    at org.jinterop.winreg.IJIWinReg$createKey.read(IJIWinReg.java:459)
    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_CreateKey(JIWinRegStub.java:30

    The WMI service is running on the server…the two services Server and Remote Registry are also running.

    Any ideas would be highly appreciated!
    Thanks in advance
    Kurt

     
  • Vikram Roopchand

    Hi,
         I think this has to do with Permissions as in 2K8 R2 registry modifications can only be done by a Trusted installer role …  I may not be right :) … we haven't done much research into this issue. But it is a good place to start.

    best regards,
    Vikram

     
  • kurt

    kurt - 2010-06-11

    Hi vikramrc,

    thanks for the quick reply. I'm not familiar with the trusted installer concept and I actually do not want to modify the Registry. The final purpose would be to access and modify the WMI interface on a Hyper-V server. I attached a screenshot of the wireshark trace from the client side (IP X.X.90.150 is the Win 2k8 server):

    Thanks again
    Kurt

     
  • kurt

    kurt - 2010-06-11

    Hi all,

    I finally got access to the Wbem Scripting Locator! Trick was to first change the owner of that registry key (to administrators) within the server and then change the permissions for the administrators group to full control.

    So far so good. Now I'm querying the following:

    results = wbemServices_dispatch.callMethodA("ExecQuery", new Object{new JIString("select * from Msvm_InternalEthernetPort"), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),JIVariant.OPTIONAL_PARAM()});

    to get the network interfaces for all virtual machines. The issue is that, with the MSWMI2 example code, the following line gives me an exception:

    JIVariant Count = wbemObjectSet_dispatch.get("Count");

    org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. 
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:333)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.get(JIDispatchImpl.java:418)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.get(JIDispatchImpl.java:435)
    at mainpackage.MSWMI2.performOp(MSWMI2.java:124)
    at mainpackage.MSWMI2.main(MSWMI2.java:177)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. 
    at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1079)
    at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:957)
    at ndr.NdrObject.decode(NdrObject.java:36)
    at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
    at rpc.Stub.call(Stub.java:113)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:901)
    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:856)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:266)
    at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:153)
    at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:315)

    Any idea how I could "look into" the wbemObjectSet_dispatch object? Or in other terms: How do I know which parameters are available for the wbemObjectSet_dispatch.get() function?

    Thanks
    Kurt

     
  • Vikram Roopchand

    Hi,
         You will have to look at MSDN help for this. Also , catch JIAtumationException (getExceptInfo helper method) instead of JIException.

    best regards,
    Vikram

     
  • Carlos Salguero

    Carlos Salguero - 2011-02-11

      
       1. Launch 'regedit.exe' as 'Administrator'
       2. Find the following registry key: 'HKEY_CLASSES_ROOT\CLSID\{76A64158-CB41-11D1-8B02-00600806D9B6}'
       3. Right click and select 'Permissions'
       4. Click the 'Advanced' button.
       5. Select the tab labeled 'Owner'
       6. Add the user you want to allow to connect to the owners list
       7. Click the 'Ok' button.
       8. Now highlight the user and grant Full Control
       9. Click 'Ok'

    Retrieved from "http://www.opennms.org/wiki/WmiConfiguration"

     
  • Scott Selikoff

    Scott Selikoff - 2011-11-15

    I'm having the same issues in Windows 7.  I can connect for read access, but setting autoRegistration to true results in an Access Denied exception.  I tried the steps above for modifying the registry but no change.  Any help?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks