So I’m pretty new at PS. So I’m creating a script that obtains the computer name through an IP address. I also want to show the last users who logged into that same workstation. That is where I’m having the trouble.
$ipAddress= Read-host “Enter IP Address”
nbtstat -a $ipAddress
Get-Item “$((Get-Item $env:USERPROFILE).Parent.FullName)*NTUSER.DAT” -Force
powershell.exe -noexit
submitted by /u/n4k3dm0s3s
[link] [comments]
The post Getting a list of the last user login after obtaining a computer name by ip address appeared first on How to Code .NET.