English 中文(简体)
Psexec "run as (remote) admin"
原标题:

I wrote some c# code that uses PSexe. I want it to run a remote exe on a machine connected to my LAN.

That exe creates a new local user. When I run that exe locally on the remote machine (after right click --> "run as Admin") - it works fine. I don;t know how to simulate the right click --> "run as Admin" from Psexec. I have tried the -l flag but it didn t work

最佳回答

Use psexec -s

The s switch will cause it to run under system account which is the same as running an elevated admin prompt. just used it to enable WinRM remotely.

问题回答

Simply add a -h after adding your credentials using a -u -p, and it will run with elevated privileges.





相关问题
How to run an executable as a system service?

I ve got a file and data distribution application written in .NET 2.0 I ve written similar to Steam. This application will need to run in Windows 7 and will need to be able to run and install ...

Adding "Network Service" Account to Administrators Group

My web-app runs in IIS 6.0 under windows server 2003, and we all know that in this situation, user account "Network Service" is used by IIS. I happen to have to allow certain user to perform some ...

Admin rights for a single method

Is it possible to require administrator rights for one single method? Something like this: [RequireAdminRightsForThisMethod()] private void TheMethod(){ // Do something }

asp.net run program with Administrator account

I need to run one console application from ASP.NET application using Administrator account and with Desktop interaction enabled. I have tried code below, console app runs ok but within NETWORK SERVICE ...

Simple check in java to find out if running as administrator

Is there a simple, quick, non-invasive windows admin task that can be performed from a java process to validate if the current process is running as administrator? I know we could run batch commands ...

热门标签