Here is the code that I am using ->
ConnectionOptions options = new ConnectionOptions();
options.EnablePrivileges = true;
options.Authentication =
System.Management.AuthenticationLevel.Call;
options.Impersonation = ImpersonationLevel.Impersonate;
string strConnectTo = "\\\\" + m_strRemote
+ "\\root\\cimv2";
ManagementScope scope = new ManagementScope(strConnectTo);
scope.Connect();
ManagementClass processClass = new ManagementClass
("Win32_Process");
processClass.Scope = scope;
ManagementBaseObject inParams =
processClass.GetMethodParameters("Create");
inParams["CommandLine"] = "calc.exe";
ManagementBaseObject outParams =
processClass.InvokeMethod ("Create", inParams, null);
The following is a link to setting user security.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
setting_user_security.asp
Regards,
Chung Wei
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <j_kerchev...@msn.com> wrote in message
news:fc7701c259a9$a38bfa00$35ef2ecf@TKMSFTNGXA11...
The following is a link to setting user security.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
setting_user_security.asp
Regards,
Chung Wei
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <j_kerchev...@msn.com> wrote in message
news:fc7701c259a9$a38bfa00$35ef2ecf@TKMSFTNGXA11...
Jeremy
>.
>
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <jkerchev...@expressmetrix.com> wrote in message
news:0dfc01c25dd9$9ceb7c00$9de62ecf@tkmsftngxs01...
Jeremy
>.
>
As far as the other issue goes, are you sure that it didn't create the
process because when executed against Windows XP or Win2k SP3 the process
will not be created interactively, it will be hidden but you can still see
the process in Task Manager. Please verify this before I look at your code.
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <jkerc...@expressmetrix.com> wrote in message
news:28fe01c25f6d$cf1fffd0$35ef2ecf@TKMSFTNGXA11...
When I run the .NET code below I get is "An unhandled
exception of type 'System.ExecutionEngineException'
occurred in system.management.dll"
So, I can't get it to work in any environment.
Thanks,
Jeremy
>.
>
Can you repro this via Wbemtest.exe ?
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <jkerc...@expressmetrix.com> wrote in message
news:389a01c26031$d5a17ef0$39ef2ecf@TKMSFTNGXA08...
//Make a connection to a remote computer using these
options
string strConnectTo = "\\\\" + m_srCurrent
+ "\\root\\cimv2";
try
{
ManagementScope scope = new ManagementScope(strConnectTo);
scope.Connect();
if (!scope.IsConnected)
{
MessageBox.Show("Not Connected to " + m_srCurrent);
return;
}
//Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass
("Win32_Process");
processClass.Scope = scope;
// Option 1: Invocation using parameter objects
//================================================
//Get an input parameters object for this method
ManagementBaseObject inParams = null;
// The following call gives a
inParams = processClass.GetMethodParameters("Create");
//Fill in input parameter values
inParams["CommandLine"] = "notepad.exe";
//Execute the method
ManagementBaseObject outParams =
processClass.InvokeMethod ("Create", inParams, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
*****
Works against a .NET Server (RC1), and it is running non-
interactively. However, running the same exact code
against a Win2k (no SPs) results in
"An unhandled exception of
type 'System.ExecutionEngineException' occurred in
system.management.dll" on the
inParams = processClass.GetMethodParameters("Create");
line.
>.
>
Also,
I can use the .NET code from Windows XP to .NET Server,
but it fails from Windows XP to Windows 2000.
Jeremy
>.
>
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jeremy" <jkerc...@expressmetrix.com> wrote in message
news:5ee301c2635a$1867d6a0$2ae2...@phx.gbl...
"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message
news:3d89245e$1...@news.microsoft.com...
--
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ori" <ori....@appilog.com> wrote in message
news:u7at1LrnCHA.456@TK2MSFTNGP11...