Windows Server Core 2022--安装DHCP

一年好景君须记,最是橙黄橘绿时。这篇文章主要讲述Windows Server Core 2022--安装DHCP相关的知识,希望能为你提供帮助。
1.安装 DHCP:
Install-WindowsFeature -Name DHCP
Add-DhcpServerv4Scope -Name 192.168.111.0 -StartRange 192.168.111.50 -EndRange 192.168.111.90 -SubnetMask 255.255.255.0
Set-DhcpServerv4OptionValue -ScopeID 192.168.111.0 -DNSServer 192.168.111.10 -DNSDomain afd.ink -Router 192.168.111.2
Add-DhcpServerInDC -DnsName dc.afd.ink
Get-DhcpServerv4Scope | Select-Object -Property *
2.为SCCM PXE OSD 配置DHCP:
$DhcpHost = DC
$DhcpFQDN = DC.afd.ink
# address of DHCP host
$ScopeID   = 192.168.111.0
# address of PXE host
$Option66 = 192.168.111.11
# Set Vendor Classes:
Add-DhcpServerv4Class -Name "PXEClient (UEFI x64)" -Description "PXEClient:Arch:00007" -Type Vendor -Data "PXEClient:Arch:00007"
Add-DhcpServerv4Class -Name "PXEClient (UEFI x86)" -Description "PXEClient:Arch:00006" -Type Vendor -Data "PXEClient:Arch:00006"
Add-DhcpServerv4Class -Name "PXEClient (Bios x86 & x64)" -Description "PXEClient:Arch:00000" -Type Vendor -Data "PXEClient:Arch:00000"
# Create DHCP Policies (Leaving out the "ScopeId" option will make the policy a server level policy):
Add-DhcpServerv4Policy -Name "PXEClient (UEFI x64)" -Description "UEFI x64 PXE" -Condition OR -VendorClass EQ, "PXEClient (UEFI x64)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID
Add-DhcpServerv4Policy -Name "PXEClient (UEFI x86)" -Description "UEFI x86 PXE" -Condition OR -VendorClass EQ, "PXEClient (UEFI x86)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID
Add-DhcpServerv4Policy -Name "PXEClient (BIOS x86 & x64)" -Description "BIOS x86 & x64 PXE" -Condition OR -VendorClass EQ, "PXEClient (BIOS x86 & x64)*" -ComputerName $DhcpFQDN -ScopeId $ScopeID
【Windows Server Core 2022--安装DHCP】# Set Policy Options (If server level policy, do not specify the "ScopeId" option):  
# ....For UEFI x64
#Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 60 -Value PXEClient 
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 66 -Value $Option66  
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x64)" -OptionId 67 -Value "smsboot\\x64\\wdsmgfw.efi"  
# ....For UEFI x86
###Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 60 -Value PXEClient  
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 66 -Value $Option66  
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (UEFI x86)" -OptionId 67 -Value "smsboot\\x86\\wdsmgfw.efi"  
# ....For BIOS x86 & x64
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (BIOS x86 & x64)" -OptionId 66 -Value $Option66  
Set-DhcpServerv4OptionValue -ComputerName $DhcpHost -ScopeId $ScopeID -PolicyName "PXEClient (BIOS x86 & x64)" -OptionId 67 -Value "smsboot\\x64\\wdsnbp.com"  





    推荐阅读