Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How do I omit 5 or so DCs in a Get-ADDomainController search?

$
0
0

Hello,

We have about 110 Domain Controllers and sometimes I want the whole list with the exception of 5 or so such as the RODCs or DCs in a site, etc.  What is the best way to 'omit' the 5 or so machines from the query below?  So for example, if I didnt want DCUS1, DCGBR3, DCSA1, DCSA16, and DCMOS in the following list, I do I omit them easily?

$MyDC=Get-ADDomainController-filter*|SortName|Select-ExpandPropertyName


Thanks for your help! SdeDot



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>