Skip to content

Instantly share code, notes, and snippets.

@SweetAsNZ
Created February 7, 2022 03:06
Show Gist options
  • Save SweetAsNZ/205e84a6d6cc4f810a92048cbbcb2eb0 to your computer and use it in GitHub Desktop.
Save SweetAsNZ/205e84a6d6cc4f810a92048cbbcb2eb0 to your computer and use it in GitHub Desktop.
Get AD Joined Servers Including Disabled
function Get-Servers {
# Includes Disabled Servers
Get-ADComputer -Filter * -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 |
Where-Object {$_.OperatingSystem -like "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