Auth using AD username?
See original GitHub issueIs it possible to authenticate using an Active Directory (AD) username?
>>> import winrm
>>> s = winrm.Session('192.168.123.158', auth=('example.com\Administrator', 'V@grant'))
>>> s.run_cmd('echo test')
Traceback (most recent call last):
File "<ipython-input-10-231983453a9e>", line 1, in <module>
s.run_cmd('echo test')
File "/home/jakob/pywinrm/winrm/__init__.py", line 29, in run_cmd
shell_id = self.protocol.open_shell()
File "/home/jakob/pywinrm/winrm/protocol.py", line 118, in open_shell
rs = self.send_message(xmltodict.unparse(rq))
File "/home/jakob/pywinrm/winrm/protocol.py", line 190, in send_message
return self.transport.send_message(message)
File "/home/jakob/pywinrm/winrm/transport.py", line 99, in send_message
raise UnauthorizedError(transport='plaintext', message=ex.msg)
UnauthorizedError: 401 Unauthorized. basic auth failed
Using winexe works:
$ winexe -U 'example.com\Administrator'%V@grant //192.168.123.158 'cmd.exe /c echo test'
test
Using the local administrator also works:
>>> import winrm
>>> s = winrm.Session('192.168.123.158', auth=('Administrator', 'V@grant'))
>>> s.run_cmd('echo test')
<Response code 0, out "test
", err "">
kind regards, Jakob
Issue Analytics
- State:
- Created 9 years ago
- Comments:10
Top Results From Across the Web
User authentication and user authorization process
AD authorization process is used to secure the AD resources from unauthorized access. After a user is authenticated using the AD authentication ......
Read more >Example of Only Authenticating User Accounts Using LDAP
The LDAP/AD Auth Resource Editor page allows you to define an Authentication Resource for use with an AD user store. An LDAP/AD Authentication...
Read more >Azure Active Directory authentication overview - Microsoft Entra
In Azure Active Directory (Azure AD), authentication involves more than just the verification of a username and password. To improve security ...
Read more >LDAP user authentication explained - Connect2id
LDAP user authentication is the process of validating a username and password combination with a directory server such MS Active Directory, ...
Read more >Active Directory Authentication - Oracle Help Center
To use standard connections, type the user name and password of a user that has privileges to search Active Directory in the User...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is working on Windows 2012R2 with domain account.
Here is my winrm configuration
Domain credentials require
ntlm
,kerberos
, orcredssp
support. Basic auth only works for local accounts. This is simply specified by usingtransport='ntlm/kerberos/credssp'
on the constructor.