Hello,
I'm trying to get AD computers based on their Operating System and the groups they are not a member of. I've been googling a lot and trying different things but can not get it to work so I'm hoping you guys can help me out.
This is the piece of script I'm trying to get to work:
Get-ADComputer-Filter {OperatingSystem-like"Windows Server*"} -server domain.local|Where-Object {$_.Memberof -notlike$gb-and$_.Memberof -notlike$gnob}
$gb = group1
$gnob = group2