Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. WMI

WMI

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdotnetdesign
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    siva455
    wrote on last edited by
    #1

    Hi, As im new to WMI please help me out regarding the problem which is as follows... WMI connection through asp.net from Computer A(windows 2003 server) to Computer B(Windows XP). the code is as follows... ConnectionOptions options = new ConnectionOptions(); options.Username =username; options.Password = password; string machinename = "*******"; // Read registry of remote machine.... ManagementScope myScope = new ManagementScope("\\\\" + machinename + "\\root\\default", options); myScope.Options.EnablePrivileges = true; myScope.Options.Impersonation = ImpersonationLevel.Impersonate;myScope.Options.Authentication = AuthenticationLevel.Packet; myScope.Connect(); and the error is as follows Server Error in '/Skywebadmin' Application. -------------------------------------------------------------------------------- The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x800706ba): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)] System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0 System.Management.ManagementScope.InitializeGuts(Object o) +711 System.Management.ManagementScope.Initialize() +162 System.Management.ManagementScope.Connect() +4 sk._Default.Page_Load(Object sender, EventArgs e) +167 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Versio

    C A 2 Replies Last reply
    0
    • S siva455

      Hi, As im new to WMI please help me out regarding the problem which is as follows... WMI connection through asp.net from Computer A(windows 2003 server) to Computer B(Windows XP). the code is as follows... ConnectionOptions options = new ConnectionOptions(); options.Username =username; options.Password = password; string machinename = "*******"; // Read registry of remote machine.... ManagementScope myScope = new ManagementScope("\\\\" + machinename + "\\root\\default", options); myScope.Options.EnablePrivileges = true; myScope.Options.Impersonation = ImpersonationLevel.Impersonate;myScope.Options.Authentication = AuthenticationLevel.Packet; myScope.Connect(); and the error is as follows Server Error in '/Skywebadmin' Application. -------------------------------------------------------------------------------- The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x800706ba): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)] System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0 System.Management.ManagementScope.InitializeGuts(Object o) +711 System.Management.ManagementScope.Initialize() +162 System.Management.ManagementScope.Connect() +4 sk._Default.Page_Load(Object sender, EventArgs e) +167 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Versio

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You expect this to work over the internet ? It looks to me like you're hopelessly lost.

      Christian Graus Driven to the arms of OSX by Vista.

      S 1 Reply Last reply
      0
      • C Christian Graus

        You expect this to work over the internet ? It looks to me like you're hopelessly lost.

        Christian Graus Driven to the arms of OSX by Vista.

        S Offline
        S Offline
        siva455
        wrote on last edited by
        #3

        I expect that to work in intranet..please help me regrding the same....

        C 1 Reply Last reply
        0
        • S siva455

          I expect that to work in intranet..please help me regrding the same....

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) This means what it says. Either the server is not available, or it's not visible, or your connection details are wrong.

          Christian Graus Driven to the arms of OSX by Vista.

          S 1 Reply Last reply
          0
          • C Christian Graus

            The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) This means what it says. Either the server is not available, or it's not visible, or your connection details are wrong.

            Christian Graus Driven to the arms of OSX by Vista.

            S Offline
            S Offline
            siva455
            wrote on last edited by
            #5

            Server is available...connection details are correct... But the sytem(which is in the local machine domain ie a test machine) from where im trying to connect is in different domain from the system(a developer machine) to which im trying to connect but both the systems are in network....

            A 1 Reply Last reply
            0
            • S siva455

              Server is available...connection details are correct... But the sytem(which is in the local machine domain ie a test machine) from where im trying to connect is in different domain from the system(a developer machine) to which im trying to connect but both the systems are in network....

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              I think you are not mentioning the Domain Name.

              ConnectionOptions connection = new ConnectionOptions();
                          connection.Username = strusername;
                          connection.Password = strpassword;
                          connection.Authority = "ntlmdomain:**Mydomain**";
              
                          ManagementScope scope = new ManagementScope(
                              "\\\\\\\\123.456.678.987\\\\root\\\\CIMV2", connection);
                          scope.Connect();
              

              cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

              S 1 Reply Last reply
              0
              • A Abhijit Jana

                I think you are not mentioning the Domain Name.

                ConnectionOptions connection = new ConnectionOptions();
                            connection.Username = strusername;
                            connection.Password = strpassword;
                            connection.Authority = "ntlmdomain:**Mydomain**";
                
                            ManagementScope scope = new ManagementScope(
                                "\\\\\\\\123.456.678.987\\\\root\\\\CIMV2", connection);
                            scope.Connect();
                

                cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

                S Offline
                S Offline
                siva455
                wrote on last edited by
                #7

                Ya when i gave the domain ie "ntlmdomain:MYdomain" it is giving me error as... May i know is there any limitation for WMI connection between Windows 2003 server and Windows Xp pro System.Management.ManagementException: Invalid parameter

                A 1 Reply Last reply
                0
                • S siva455

                  Ya when i gave the domain ie "ntlmdomain:MYdomain" it is giving me error as... May i know is there any limitation for WMI connection between Windows 2003 server and Windows Xp pro System.Management.ManagementException: Invalid parameter

                  A Offline
                  A Offline
                  Abhijit Jana
                  wrote on last edited by
                  #8

                  pradeep455 wrote:

                  Ya when i gave the domain ie "ntlmdomain:MYdomain" it is giving me error as...

                  Did you write your domain name? I mean Suppose I am working in Domain "Abc", So I should mention ntlmdomain:Abc, If your domain is "Xyz", placed your domain name over there.

                  pradeep455 wrote:

                  May i know is there any limitation for WMI connection between Windows 2003 server and Windows Xp pro

                  No, there should not be any problems. BTW: Why you are using this in ASP.Net? What is the purpose?:confused:

                  cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

                  S 1 Reply Last reply
                  0
                  • A Abhijit Jana

                    pradeep455 wrote:

                    Ya when i gave the domain ie "ntlmdomain:MYdomain" it is giving me error as...

                    Did you write your domain name? I mean Suppose I am working in Domain "Abc", So I should mention ntlmdomain:Abc, If your domain is "Xyz", placed your domain name over there.

                    pradeep455 wrote:

                    May i know is there any limitation for WMI connection between Windows 2003 server and Windows Xp pro

                    No, there should not be any problems. BTW: Why you are using this in ASP.Net? What is the purpose?:confused:

                    cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

                    S Offline
                    S Offline
                    siva455
                    wrote on last edited by
                    #9

                    !Abhijit Jana wrote: No, there should not be any problems. BTW: Why you are using this in ASP.Net? What is the purpose? a) Ya because it"s actually for admin purpose to connect to other systems and get hard disk info etc... and that he has to see all this thru web that"s the problem.. b)And one more issue Abhijith if possible please try to help me out... I have a web application in where in my default page cs file i didn"t write anything and i have created an msi using set up and deployment provided by VS 2005 and installed that msi in other machine and when im trying access it thru url im getting the below error.... Server Error in '/Skywebadmin' Application. -------------------------------------------------------------------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Requested registry access is not allowed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: SecurityException: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

                    1 Reply Last reply
                    0
                    • S siva455

                      Hi, As im new to WMI please help me out regarding the problem which is as follows... WMI connection through asp.net from Computer A(windows 2003 server) to Computer B(Windows XP). the code is as follows... ConnectionOptions options = new ConnectionOptions(); options.Username =username; options.Password = password; string machinename = "*******"; // Read registry of remote machine.... ManagementScope myScope = new ManagementScope("\\\\" + machinename + "\\root\\default", options); myScope.Options.EnablePrivileges = true; myScope.Options.Impersonation = ImpersonationLevel.Impersonate;myScope.Options.Authentication = AuthenticationLevel.Packet; myScope.Connect(); and the error is as follows Server Error in '/Skywebadmin' Application. -------------------------------------------------------------------------------- The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x800706ba): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)] System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0 System.Management.ManagementScope.InitializeGuts(Object o) +711 System.Management.ManagementScope.Initialize() +162 System.Management.ManagementScope.Connect() +4 sk._Default.Page_Load(Object sender, EventArgs e) +167 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Versio

                      A Offline
                      A Offline
                      Ashutosh Phoujdar
                      wrote on last edited by
                      #10

                      pradeep455 wrote:

                      The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                      Can you please try to inspect if WMI service is running on target machine : C:\>sc query winmgmt SERVICE_NAME: winmgmt TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 If it is not running then start with : C:\>sc start winmgmt

                      dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                      S 1 Reply Last reply
                      0
                      • A Ashutosh Phoujdar

                        pradeep455 wrote:

                        The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                        Can you please try to inspect if WMI service is running on target machine : C:\>sc query winmgmt SERVICE_NAME: winmgmt TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 If it is not running then start with : C:\>sc start winmgmt

                        dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                        S Offline
                        S Offline
                        siva455
                        wrote on last edited by
                        #11

                        Ya Wmi service is running ,firewall is off, Rpc is running,Remote registry is also running....

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups