Share via

Get-ADComputer: List Windows Servers that are enabled only

Raul Chiarella 21 Reputation points
2022-03-01T21:14:47.61+00:00

Hello everyone!
I know the following command that lists Windows Servers

Get-ADComputer -Filter { OperatingSystem -Like 'Windows Server'}

But i want to show enabled Servers only... How do i use two filters in the same command?
I know this seems a very newbie question but i'm newbie on Powershell, so... :|

Thanks in advance!

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

  1. Rich Matheisen 48,116 Reputation points
    2022-03-01T22:10:25.4+00:00

    Combine them with an '-and' operator:

    Get-ADComputer -Filter "OperatingSystem -Like '*Windows Server*' -and Enabled -eq 'True'"
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.