AD : check a user's active log-ons

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
muijsenbergq
Posts: 92
Last visit: Fri Mar 15, 2019 2:20 am

AD : check a user's active log-ons

Post by muijsenbergq »

Hello all,

Is it possible with powershell to check for a user to which computers he/she is currently logged on in AD?
Or otherwise, how many active logons he/she has?

thanks!
User avatar
scharique
Posts: 131
Last visit: Wed Dec 03, 2014 11:02 am

AD : check a user's active log-ons

Post by scharique »

I am not sure about the first question, regarding which DC a user was authenticated against, run SET L on the cmd prompt, about the second question. start with this ,(Get Quest AD Cmdlets, if you haven't already)Get-QADUuser username | select lastlogon
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

AD : check a user's active log-ons

Post by jhicks »

None of that information is stored in AD that I'm aware of. You would need some out-of-band tool to log that information when a user logs on.
User avatar
muijsenbergq
Posts: 92
Last visit: Fri Mar 15, 2019 2:20 am

AD : check a user's active log-ons

Post by muijsenbergq »

Would be handy info for AD to store though..i'll do it another way then.Anyway,thanks for your replies.
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

AD : check a user's active log-ons

Post by jhicks »

You could add code in a user's logon script to add the computer name to a field in their AD user object. There is a Notes field, which I think the user has write access to. The challenge would be handling multiple logons and cleaning it up when the user logged off.
User avatar
muijsenbergq
Posts: 92
Last visit: Fri Mar 15, 2019 2:20 am

AD : check a user's active log-ons

Post by muijsenbergq »

OKSounds interesting.I'll look in to that.thnks.
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked