I got a list of DHCP servers and I need to find a site and an operating system for each server, but it either fails or runs in loop if I write -filter *:
$servers = Get-Content -Path 'C:\users\user\Desktop\Has connection.txt'
foreach($server in $servers) {
Get-ADReplicationSite -filter operatingsystem,site
}
You're not calling the -Server parameter and it looks like you want to get the properties "operatingsystem,site"? In that case use -Properties instead like this: