OK got it.
SO when i got home i played around with this and am getting closer to what i want to do, but essentially, this question is answered. So here is the solution I came up with in case anyone is interested :
Windows CMD/Powerhshell has :
query user /server:<hostname>
which return all logged in users from the command line/powershell prompt.
So using this in conjuction with the rest goes something like this...
Dropping into a python box :
>>> import os
>>> os.system('query user /server:myservername')
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
john.doe ica-tcp#70 1 Active 7 13/02/2017 8:11
now all i need to do is put this into a count loop, maybe counting each line and dropping the first one.
Hope this helps someone else. Please feel free to post another solution. Always happy to learn!
SO when i got home i played around with this and am getting closer to what i want to do, but essentially, this question is answered. So here is the solution I came up with in case anyone is interested :
Windows CMD/Powerhshell has :
query user /server:<hostname>
which return all logged in users from the command line/powershell prompt.
So using this in conjuction with the rest goes something like this...
Dropping into a python box :
>>> import os
>>> os.system('query user /server:myservername')
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
john.doe ica-tcp#70 1 Active 7 13/02/2017 8:11
now all i need to do is put this into a count loop, maybe counting each line and dropping the first one.
Hope this helps someone else. Please feel free to post another solution. Always happy to learn!
Say NO to TROLLs!! **naughty**