
Powershell
Bin Xiao
专注运维、基础架构技术
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
获取远端计算机的DNS
批量查询服务器DNS设置: 先将要查询的服务器列表保存在一个文本文件servers.txt中,然后保存以下脚本到getdns.ps1文件中,最后在PowerShell中执行getdns.ps1脚本,结果会输出到serverdns.txt中。此脚本中搜索的是网卡名称为LAN的网卡然后进行设置,如果网卡为别的名称,请作相应的更改,所以合理规划并定义网卡名称也是很有必要的。 脚本一,获取DNS,IP,...原创 2019-04-21 20:28:16 · 554 阅读 · 0 评论 -
Get-IPaddress 通过计算机名获取IP地址
方法一 $CSVFile = “C:\IPAddress.csv” $ServerList = “C:\ServerList.txt” Get-Content $ServerList |Foreach { $Result = “”|select “ComputerName”,“IPAddress” $Result.ComputerName = $_ try{ IPAddress=([System....原创 2019-04-21 20:29:14 · 591 阅读 · 0 评论 -
Get-Delete 2days file
脚本一: $path = ‘C:\Users\HuiBinXiao\Desktop\Temp’ #此路径下的文件需要删除 $limit = (Get-Date).AddDays(-2) #-2 是设置删除2天前的文件 Get-ChildItem $path -file -Recurse | ? {-not $.PSIsContainer -and $.Creati...原创 2019-04-21 20:32:44 · 319 阅读 · 0 评论 -
个人微信公众号
欢迎大家关注我的个人微信公众号原创 2019-08-20 09:49:29 · 451 阅读 · 0 评论