Try the Get-DhcpServerInDC cmdlet to get the names of the authorized DHCP servers. Pipe the server name into a ForEach-Object loop and use that name as the value for the -ComputerName in your existing script.
How to conigure 161 DHCP Option for multiple server using powershell
Mohd Arif
951
Reputation points
I have to run the below command on multiple DHCP servers, let say DHCP01, DHCP02, DHCP03, DHCP04. Below command is fine, I have run it one few servers one by one and it works good. But, I need to specify on all servers in one time so I need to configure some logic which I am not able to think of. Please help me.
Get-DhcpServerv4Scope -ComputerName server01.superit.in | Where-Object {$_.Name -like "telephony"} | Set-DhcpServerv4OptionValue -ComputerName $Server -OptionId 161 -Value 'HTTPS://Polycom.super.in:8443'