Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Check if the Servernames are in both Arrays

Hey guys I have a little problem. I’m doing a Script where I get all the Servers in our Activ Directory Server and then compare them with all the servers that are in our ESX Servers. I want to find out which Servers are in the Active Directory that are not in the ESX Array. Both Arays have the Option "name" with what I’m trying to compair the two Arrays.

I tried doing it with foreach but couldn’t get it to work. Can somebody help?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

$a = 1..5
$b = 4..8

Compare-Object -ReferenceObject $a -DifferenceObject $b | Where-Object{$_ -match "<="}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading