Skip to content

Wintel Commands


Ping Multiple Addresses In a Loop on Windows
PowerShell Get FSMO List
Dig on Windows
cURL on Windows

Want to help? If you’d like to help please use the contact page and send me a message


Ping Multiple Addresses In a Loop on Windows \_(ʘ_ʘ)_/

.Net ping class

for /L %i in (0) do ping -n 10 <GATEWAY IP> & ping -n 10 ping <WAN GATEWAY> & ping -n 10 & ping -n 10 & ping -n 10

for /L %i in (0) do ping & ping & ping & ping & ping

# PowerShell instead of cmd.exe:
cmd.exe /C "for /L %i in (0) do ping & ping & ping & ping & ping"

# test-connection cmdlet in PowerShell:
$destination = "", "", ""
while($true){ test-connection $destination -count 1 -EA 0 -BufferSize 100 -OutBuffer 5 | Select Address,IPv4Address,ResponseTime
 sleep -MilliSeconds 5000
# There are other more reliable methods of using ping such as the .Net class, WMI and CIM
$Timeout = 100
$Name = ""
$Ping = New-Object System.Net.NetworkInformation.Ping
$Response = $Ping.Send($Name,$Timeout)
Write-Host "Common output:"
Write-Host "Resonse time (ms): " $Response.RoundtripTime
Write-Host "IPv4 Address: "$Response.Address.IPAddressToString
Write-Host "Success/Timed out?: "$Response.Status
Write-Host "Detailed output:"

PowerShell: Get List of FSMO Role Holders

Get-ADDomain | Select-Object InfrastructureMaster, RIDMaster, PDCEmulator
Get-ADForest | Select-Object DomainNamingMaster, SchemaMaster
Get-ADDomainController -Filter * | Select-Object Name, Domain, Forest, OperationMasterRoles | Where-Object {$_.OperationMasterRoles} | Format-Table -AutoSize

Dig Command on Windows

Don’t you feel like something is missing when you come from working on Linux for a while then switch back to Windows? These tips will make your command prompt feel a little more like the Bash shell:

Dig – you can still use dig on Windows and it’s extremely easy. Simply visit the Internet Systems Consortium’s site and download the latest stable version of Bind for your architecture of Windows (usually x64). Run the install but only install the Tools. This will install the executable for dig at this location C:\Program Files\ISC BIND 9\bin\dig.exe. Now all you have to do is point your environmental variables to look at that directory. You can download the script here or just copy and paste the two lines below:

$CurrentValue = [Environment]::GetEnvironmentVariable(“Path”, “Machine”)
[Environment]::SetEnvironmentVariable(“Path”, $CurrentValue + “;C:\Program Files\ISC BIND 9\bin”, “Machine”)

After you’ve completed those steps you can run dig queries once you’ve opened a new command window:

C:\Windows\system32>dig @ +noall +answer
; <<>> DiG 9.10.4-P2 <<>> @ +noall +answer
 ; (1 server found)
 ;; global options: +cmd 3443 IN CNAME 49 IN A 49 IN A 49 IN A 49 IN A

cURL Command on Windows

Download cURL here or use this direct link then throw it in Windows directory. Try querying for your public IP address.

  "ip": "",
  "city": "Huntington Beach",
  "region": "California",
  "country": "US",
  "loc": "33.6603,-117.9990",
  "org": "AS5650 Frontier Communications of America, Inc.",
  "postal": "92648"

Leave a Reply

Your email address will not be published. Required fields are marked *