Is there a way to change active user in windows cmd?

Anonymous
2025-02-25T08:40:17+00:00

I am a domain administrator.

Often I have to execute commands remotely on the users' PCs but not as a domain administrator, as a simple user with whom they use the pc.

I don’t know the users' passwords.

I use pstools but enter as domain administrator.

Is there a way to change user without knowing the password?

Windows for business | Windows Server | Networking | Network connectivity and file sharing

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-02-26T06:18:15+00:00

    If you're a domain administrator but don't know the target user's password, there is no direct way to switch to that user in Windows CMD.

    However, you can try the following methods:

    1. Use the runas command: This requires entering the target user's password.
    2. runas /user:DOMAIN\username "cmd.exe"
    3. Use PsExec: This also requires entering the target user's password.
    4. psexec \remote_computer -u DOMAIN\username -p password cmd
    5. Use a Scheduled Task: You can create a scheduled task on the target machine to run commands as the target user and trigger the task remotely.
    6. Use WMI: Again, you need the target user's password.
    7. wmic /node:remote_computer /user:DOMAIN\username /password:password process call create "cmd.exe /c your_command"

    In summary, if you don't know the password, you cannot directly switch users, but you can use some tools to execute commands as another user as long as you have the password.

    Windows Client for IT Pros and Windows Server forums are moving to Microsoft Q&A

    We’re transitioning to Microsoft Q&A for a more streamlined experience. Starting February 26th*, new questions can only be posted on* Microsoft Q&A. Existing discussions will remain accessible here.

    Beginning March 3rdcustomers looking for support on Answers will be automatically redirected to Microsoft Q&A

    0 comments No comments