Anyone know how to find Scope ?
Microsoft say
ManagementScope scope = new ManagementScope("\\\\FullComputerName\\root\\cimv2");
I work in localhost.
I already test “\\HOSTNAME\root\cimv2” and “\\HOSTNAME\MY_ACCOUNT_NAME\cimv2” but they doesn’t work.
I’m on Windows 7 Pro, I use Visual Studio 2010 and it’s .NET 4
#
Update 1
int i = Convert.ToInt32(processIds[index]);
String queryString = "select CreationDate from Win32_Process where ProcessId='" + processIds[index] + "'";
SelectQuery query = new SelectQuery(queryString);
ManagementScope scope = new System.Management.ManagementScope("\\\\XXX-PC\\YYY\\cimv2");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection processes = searcher.Get();
@keyboardP : Searcher.Get() work an exception, so I suppose my Scope it’s not right.
I’ve been developing an application that uses Management Scopes for quite some time now. I think you just have to omit the Host Name.
This works for me: