Powershell function to get all dhcp lease-Yoke
function get-dhcplease{ $dhcpservers=Get-DhcpServerInDC$dhcpscopes=$dhcpservers|%{$computername=$_.dnsname;Get-DhcpServerv4Scope -ComputerName $computername|%{$_|Add-Member -Type NoteProperty -name "computername" -Value $computername;$_}}
$dhcpscopes|%{Get-DhcpServerv4Lease -ScopeId $_.scopeid -ComputerName $_.computername}|Out-GridView
}
页:
[1]