zhu894532094 发表于 2018-9-2 09:19:23

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]
查看完整版本: Powershell function to get all dhcp lease-Yoke