[TOC]
0x00 网络连接测试 Test-Connection 命令 - 向一台或多台计算机发送ICMP回显请求数据包或ping 描述:可以类比于cmd中的nbtstat明进行获取局域网中的指定计算机名的IPv4/6地址信息以及MAC地址;
基础语法:
[TOC]
0x00 网络连接测试 Test-Connection 命令 - 向一台或多台计算机发送ICMP回显请求数据包或ping 描述:可以类比于cmd中的nbtstat明进行获取局域网中的指定计算机名的IPv4/6地址信息以及MAC地址;
基础语法:
1 2 3 4 5 PS > (Get-Command *-Connection).Name Test-Connection Test-Connection [-ComputerName] <System.String[]> [-AsJob] [-BufferSize <System.Int32>] [-Count <System.Int32>] [-DcomAuthentication {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-Delay <System.Int32>] [-Impersonation {Default | Anonymous | Identify | Impersonate | Delegate}] [-Protocol {DCOM | WSMan}] [-ThrottleLimit <System.Int32>] [-TimeToLive <System.Int32>] [-WsmanAuthentication {Default | Basic | Negotiate | CredSSP | Digest | Kerberos}] [<CommonParameters>]
基础示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 PS C:\Users\WeiyiGeek> Test-Connection -ComputerName WeiyiGeek Test-Connection -ComputerName Server01, Server02, Server12 Test-Connection 10.20.172.106 Test-Connection -Source Server02, Server12, localhost -ComputerName Server01 -Credential Domain01\Admin01 Test-Connection -ComputerName WeiyiGeek -Count 3 -Delay 2 -TTL 255 -BufferSize 256 -ThrottleLimit 32 $job = Test-Connection -ComputerName (Get-Content Servers.txt) -AsJobif ($job .JobStateInfo.State -ne "Running" ) {$Results = Receive-Job $job } Test-Connection Server55 -Credential Domain55\User01 -Impersonation Identify if (Test-Connection -ComputerName Server01 -Quiet) {New-PSSession Server01}
欢迎各位志同道合的朋友一起学习交流,如文章有误请在下方留下您宝贵的经验知识,个人邮箱地址【master#weiyigeek.top】
或者个人公众号【WeiyiGeek】
联系我。
更多文章来源于【WeiyiGeek Blog - 为了能到远方,脚下的每一步都不能少】 , 个人首页地址( https://weiyigeek.top )
专栏书写不易,如果您觉得这个专栏还不错的,请给这篇专栏 【点个赞、投个币、收个藏、关个注、转个发、赞个助】 ,这将对我的肯定,我将持续整理发布更多优质原创文章!。