Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Query Workstations in AD by Name Prefix
Get-ADComputer -Filter 'Name -like "MNS*"' -Property * | Select-Object Name, Description, DistinguishedName, OperatingSystem, OperatingSystemVersion, @{n='LastLogonTimeStamp';e={[DateTime]::FromFileTime($_.LastLogonTimeStamp)}}, WhenCreated, IPv4Address | Export-CSV .\WorkstationsLikeMNS.csv -NoTypeInformation -Encoding UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.