HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to get the last user logged into a computer with PowerShell

37,361 views October 25, 2016 6:18

Watch on YouTube
ChannelSignalWarrant

Description from the creator

🔍 Tracking Logged-In Users:
- Uses Get-ChildItem to query user profiles and retrieve the LastWriteTime for identifying the last user logged into a computer.
- Implements Get-WmiObject with Win32_Process to track the owner of the Explorer process as an alternative.

📋 Multiple User Caveat: Notes that both methods may yield multiple results if multiple users are logged into the same machine.

🔗 Practical Application: Highlights how this script can help locate devices within an organization for lifecycle or inventory management purposes.

BlueSky: bsky.app/profile/cyberautomate.bsky.social
LinkedIn: linkedin.com/in/david-hall10
Github: github.com/cyberautomate

#PowerShell #PowerShellTraining #CyberAutomate #LearnPowerShell #PowerShellAutomation

About this tutorial

SignalWarrant published this 6:18 video tutorial on October 25, 2016. It has been watched 37,361 times on YouTube.

Duration
6:18
Published
October 25, 2016
Views
37,361
Likes
215

Tags

Share

Further reading

  • Find last user logged into a machine Via Powershell? community.spiceworks.com

    All I want it to do is to give me the last username that logged into a specific machine. I use this powershell script to get the last logon date but can't find out who was the last user to log on , Get-ADComputer -ident…

  • How to get the last user logged into a computer with ... signalwarrant.com

    How to get the last user logged into a computer with PowerShell August 16, 2016 David Hall As an Administrator, I have been asked more than once to find out where a computer is on the network.

  • Find Last Logon Time/Date of Users/Computers | Powershell & AD webservertalk.com

    3. Find AD Users Last Logon Time Using the Attribute Editor. You can also find a Single Users Last logon time using the Active Directory Attribute Editor. You can follow the below steps below to find the last logon time…

This tutorial in other languages