Hello,
I am trying to build a list of servers based on results from AD and vSphere and combine them to a single variable to use later in my script.
I just cant figure how to process booth in a loop to create an array variable $Computers
$ADComps = Get-ADComputer -Filter {OperatingSystem -like "*Server*"} | select -expandproperty DNSHostname
$VMComps = Get-VM | Get-VMGuest | ? {$_.OSFullName -notlike "*Server*"} | ? {$_.OSFullName -notlike "*Linux*"} | ? {$_.OSFullName -notlike "*Cent*"} | ? {$_.OSFullName -notlike "*other*"} | ? {$_.OSFullName -notlike $Null} |? {$_.State -notlike "*NOT*"} | Select HostName