Open1

DHCP Server の Scope を PowerShell で設定する方法

syuheiudasyuheiuda

Learn

https://learn.microsoft.com/ja-jp/windows-server/networking/technologies/dhcp/dhcp-deploy-wps

PS

Get-DhcpServerv4Scope
Get-DhcpServerv4Superscope

# Scope 追加
for($i=0; $i -lt 32; $i++){Add-DhcpServerv4Scope -name "172.16.$i.0" -StartRange "172.16.$i.1" -EndRange "172.16.$i.254" -SubnetMask 255.255.255.0 -State Active}Get-DhcpServerv4Scope

# 既存の DHCP Scope のオプションをコピー
for($i=0; $i -lt 32; $i++){Get-DhcpServerv4OptionValue -ScopeId "xxxxx" | Set-DhcpServerv4OptionValue -ScopeId 172.16.$i.0}

# SuperScope に追加
for($i=0; $i -lt 32; $i++){Add-DhcpServerv4Superscope -SuperscopeName "Mgmt" -ScopeId "172.16.$i.0" -Force}