-1

I've been trying since a while and googled a lot but couldn't find proper support. Running .Net based project on Mon and trying to fetch Process id running on a remote windows machine. And cannot go ahead...

ConnectionOptions connectoptions = new ConnectionOptions();     
string ipAddress = "XX.XX.X.XXX";

ManagementScope scope = new ManagementScope(@"\\" + ipAddress + @"\root\cimv2", connectoptions);
scope.Options = connectoptions; 
var query = new SelectQuery("select * from Win32_process where name = '" +    ProcessName + "'");
List<int> EPids = new List<int>();

using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query))
{
    foreach (ManagementObject EProcess in searcher.Get()) 
    {
       var pId = Convert.ToInt32(EngineProcess["ProcessId"]);                                
                EnginePids.Add(pId);
                Console.WriteLine(pId);                                                  
    }
}           
return EPids.ToArray();

At

scope.Options = connectoptions

I recive a System.NotImplemented exception. Wondering if MONO actually supports this?

Johan
  • 8,068
  • 1
  • 33
  • 46

1 Answers1

0

Nothing is implemented in the ManagementScope Class:

System.Management/System.Management/ManagementScope.cs

public ConnectionOptions Options {
   [MonoTODO]
   get {
      throw new NotImplementedException ();
   }
   [MonoTODO]
   set {
      throw new NotImplementedException ();
   }
}

Ref: https://github.com/mono/mono/blob/b7a308f660de8174b64697a422abfc7315d07b8c/mcs/class/System.Management/System.Management/ManagementScope.cs

SushiHangover
  • 73,120
  • 10
  • 106
  • 165