Skip to content

Instantly share code, notes, and snippets.

@SweetAsNZ
Created February 7, 2022 03:03
Show Gist options
  • Save SweetAsNZ/0f71ba74703efc3913e33d5cf7f5086d to your computer and use it in GitHub Desktop.
Save SweetAsNZ/0f71ba74703efc3913e33d5cf7f5086d to your computer and use it in GitHub Desktop.
Get AD Joined Desktops Including Disabled
function Get-Desktops{
# Includes Disabled Desktops
Get-ADComputer -Filter * -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 |
Where-Object {($_.OperatingSystem -like "Windows*") -and ($_.OperatingSystem -notlike "Windows Server*")} |
Select-Object Name,Enabled,OperatingSystem | Sort-Object Name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment