Start CMD Admin - psexec

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

Start CMD Admin - psexec

Post by MigrationUser »

02 Oct 2013 06:36
dima4ka

Hi @all,

how can I start cmd for examply with psexec as Administartor without type any passwords?

attempts:
Runas /env /user:hostname@domain CMD

psexec -s -i cmd -u user -p password

who can help me?

----------------------------

#2 09 Oct 2013 15:34
diasje

Code: Select all

psexec \\hostname -u domain\admuser -p admpassword  cmd
\\hostname = Computer where you whant to run psexec

domain = used if computer is in a domain

admuser = username of administrator

admpassword = password of administrator

To run psexec with a user (admin) you must allways insert a password

psexec \\hostname -u domain\admuser cmd

In this example you will get a prompt for password

is tis for your local computer? or for a remote computer?

----------------------------

#3 10 Oct 2013 11:57
dima4ka

thank a lot.

But one Problem still exists!

if i start cmd with psexec i can't start ohter program like a msc in this cmd.
if i start cmd as admin as ever, so i can start msc with drag and drop.

----------------------------

#4 10 Oct 2013 15:45
diasje


I need more info, is this a home network?
Work network?
If it is a work network you will allways need to add the mais administrator username and password.

Show your code and explain what you need to do.

----------------------------

#5 11 Oct 2013 06:41
dima4ka

this is a work network
domain.
If i open cmd with right clic open as admin and type my user and password, then the cmd-windows is called "Administrator...."
If i open with your code then the cmd-windows is called ony "cmd..." but i have limited administrations.
Psexec have some access on other clients, but if i will open an msc with adm, the cmd says "access denied".

----------------------------

#6 11 Oct 2013 22:07
diasje


Ok, if you use my code you must enter the master administration user and password, not a local admin.
You must have a network or domain user to access the admin previlegies in a remote computer, remembre that you are doing this over a network.

if you use my code and use a local admin, you should do like this:

Code: Select all

psexec \\hostname -u hostname\admuser -p admpassword  cmd
If you use my code and have a network admin you should use it like this:

Code: Select all

psexec \\hostname -u domain\admuser -p admpassword  cmd
Post Reply