Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMD Command return partial output #369

Open
idanmantin opened this issue Feb 15, 2023 · 0 comments
Open

CMD Command return partial output #369

idanmantin opened this issue Feb 15, 2023 · 0 comments

Comments

@idanmantin
Copy link

I'm trying to run CMD command using the following code in order to execute the command: net user /domain <username> but I got partial output.

My Code:

import winrm

session = winrm.Session('remote_computer', auth=('username', 'password'))
result = session.run_cmd('net user /domain ', 'username')

print(result.std_out.decode())

Output for command net user /domain myuser using the python script:

The request will be processed at a domain controller for domain ad.keyconf.com.

Output for command net user /domain myuser locally on windows machine CMD:

The request will be processed at a domain controller for domain ad.keyconf.com.

User name                    myuser
Full Name
Comment
User's comment
Country/region code          000 (System Default)
Account active               Yes
Account expires              Never

Password last set            2/15/2023 11:29:20 AM
Password expires             3/29/2023 11:29:20 AM
Password changeable          2/16/2023 11:29:20 AM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   2/14/2023 3:06:48 PM

Logon hours allowed          All

Local Group Memberships      *Remote Desktop Users
Global Group memberships     *Domain Users
The command completed successfully.
.
.
.
@idanmantin idanmantin changed the title CMD Command output return partial output CMD Command return partial output Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant