On Apr 11, 2020, at 6:32 AM, Waseem Afser <waseem.af...@gmail.com> wrote:
> 
> Is there any possible method to get the logged in user's username from a 
> windows service ? 

Your assumption that there is only one "logged in user” is false, which is why 
the information you seek is not readily available.

There is a WMI query that can return the name of all logged in users:

https://stackoverflow.com/questions/5218778/how-do-i-get-the-currently-logged-username-from-a-windows-service-in-net
 
<https://stackoverflow.com/questions/5218778/how-do-i-get-the-currently-logged-username-from-a-windows-service-in-net>
— 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to