среда, 19 апреля 2017 г.

[Powershell] Получаем список арендованных IP-адресов с DHCP-сервера

$Server = 'DHCP.local'
$Scope = Get-DhcpServerv4Scope -ComputerName $Server
$Scope | ForEach {Get-DhcpServerv4Lease -ComputerName $Server  -AllLeases -ScopeId $_.ScopeId | Select HostName, IPAddress,ClientId} | Sort-Object IPAddress

Комментариев нет:

Отправить комментарий