List computers in AD with LastLoginTimestamp

List Workstation OS computers,

get-adcomputer -filter {OperatingSystem -notlike '*server*'} -Properties OperatingSystem,LastLogonTimestamp | Sort LastLogonTimestamp | Select Name,OperatingSystem,@{Name='LastLogonTimestamp'; Expression={[DateTime]::FromFileTime($_.LastLogonTimestamp).ToString("dd/MM/yyyy")}}

List Server OS computers,

get-adcomputer -filter {OperatingSystem -notlike '*server*'} -Properties OperatingSystem,LastLogonTimestamp | Sort LastLogonTimestamp | Select Name,OperatingSystem,@{Name='LastLogonTimestamp'; Expression={[DateTime]::FromFileTime($_.LastLogonTimestamp).ToString("dd/MM/yyyy")}}
Advertisements