-1

我有一个 IP 地址列表,我需要为此列表的每个 IP 地址关联站点和子网。我有5203 IP地址,一一验证太多了;也许有人可以帮助我?谢谢你。

4

1 回答 1

0

You don't give much information as @boxdog said. I am guessing that you are using DHCP and you want to query the scopes and the IPs that are leased.

$scopes = Get-DhcpServerv4Scope -ComputerName "DHCP-Server"
foreach($scope in $scopes)
{
    write-host -ForegroundColor Cyan "The current scope name is: " -NoNewline; Write-Host -ForegroundColor Green $scope.name 
    $lease = Get-DhcpServerv4Lease -ScopeId $scope.ScopeId -ComputerName "DHCP-Server"
    $lease

}

If not then please provide more information about what you want to do. Also a script that you already wrote can be helpful.

于 2018-10-19T13:21:09.327 回答