Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active September 3, 2018 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/136b3430018f6003a01c13a88d450d35 to your computer and use it in GitHub Desktop.
Save mczerniawski/136b3430018f6003a01c13a88d450d35 to your computer and use it in GitHub Desktop.
Get-ADComputer -Filter * -SearchBase 'OU=Servers,OU=Computers,DC=contoso,DC=com' -Properties 'DNSHostName','lastLogon','lastlogontimestamp','operatingSystem','operatingSystemVersion','whenChanged','whenCreated' | Select-Object 'DNSHostName',
@{name='lastLogon';e={[datetime]::FromFileTime($PSItem.'lastLogon') }},
@{name='lastLogontimestamp';e={[datetime]::FromFileTime($PSItem.'lastLogontimestamp') }},
'operatingSystem','operatingSystemVersion','whenCreated','whenChanged','DistinguishedName',
@{name='InUse';e={''}},
@{name='CurrentAccessList';e={''}},
@{name='Applications';e={''}},
@{name='SystemUpdate';e={''}},
@{name='PM';e={''}},
@{name='TO';e={''}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment