windows - Python: How to get domain\username for logged in user -


in python how logged in username in domain\username format. following username:

import getpass import os; print(os.getlogin()) print(getpass.getuser()) 

here go :

import os domain = os.environ['userdomain'] print(domain) 

(but see doest give fqdn, netbios name)


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -