We have a situation where we require a particular type of script.
One that shows
1. The name of the domain PC/Server
2. The time and date it was logged into
3. The user that logged into it last
I have searched all over and haven't found what i am looking for
I did though find this:
Get-ADComputer -Filter * -Properties * | Sort LastLogonDate | FT Name, LastLogonDate, SID -Autosize
This gives me the Name of PC, Last login date/time and SID, i found no such option that would give me a username...
I was thinking if there was a possibility of piping the SIDs over into this command:
This will allow you to enter a SID and find the Domain User
$objSID = New-Object System.Security.Principal.SecurityIdentifier `
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
and in this way all SIDs would be translated to their domain user counterparts.
I would appreciate any assistance in this matter