windows DHCP根据MAC地址批量导出DHCP服务器中的计算机名,导出到csv

"import-csv -path C:\mac.csv | foreach {
 $a=$_.name
 Get-DhcpServerv4Scope | Get-DhcpServerv4Lease |where {$_.ClientId -like ""$a"" }}  | export-csv c:\computer.csv -NoTypeInformation -encoding utf8"

 

csv文件

name

a1d3g5hef4

posted @ 2020-07-12 20:23  会飞的老虎  阅读(515)  评论(0编辑  收藏  举报