DHCP - Report with DHCP scope option
$ListofScopesandTheirOptions = $Null
$PrimaryDHCPServer = "s217124rgvw210"
$Scopes = Get-DhcpServerv4Scope -ComputerName $PrimaryDHCPServer
#For all scopes in the primary server, get the scope options and add them to $LIstofSCopesandTheirOptions
foreach ($Scope in $Scopes)
{
$LIstofSCopesandTheirOptions += Get-DHCPServerv4OptionValue -ComputerName $PrimaryDHCPServer -ScopeID $Scope.ScopeId |select @{label=”DHCPServer”; Expression= {$PrimaryDHCPServer}},@{label=”ScopeID”; Expression= {$Scope.ScopeId}},@{label=”ScopeName”; Expression= {$Scope.Name}},*
}
#For all scopes in the primary server, get the scope options and add them to $LIstofSCopesandTheirOptions
foreach ($Scope in $Scopes)
{
$LIstofSCopesandTheirOptions += Get-DHCPServerv4OptionValue -ComputerName $PrimaryDHCPServer -ScopeID $Scope.ScopeId |select @{label=”DHCPServer”; Expression= {$PrimaryDHCPServer}},@{label=”ScopeID”; Expression= {$Scope.ScopeId}},@{label=”ScopeName”; Expression= {$Scope.Name}},*
}
Comments
Post a Comment