You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
importwinrmsession=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.
.
.
.
The text was updated successfully, but these errors were encountered:
idanmantin
changed the title
CMD Command output return partial output
CMD Command return partial output
Feb 15, 2023
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:
Output for command
net user /domain myuser
using the python script:Output for command
net user /domain myuser
locally on windows machine CMD:The text was updated successfully, but these errors were encountered: