top of page

PowerShell - Get Network Details any Remote server, prompts for server name

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 10, 2022
  • 1 min read

Save as a .ps1, Gives IP, Description, DNS, WINS, Domain, Gateway, Mac any remote Server

$colComputers = Read-Host "Enter ServerName to Discover Network Details"

foreach ($strComputer in $colComputers)

{

# PowerShell cmdlet to interrogate the Network Adapter

$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" `

-computername $strComputer | Where{$_.IpEnabled -Match "True"}

write-host --Begin-Network-Details-For--> $strComputer

foreach ($objItem in $colItems) {

write-host ""

write-host "IPAddress : " $objItem.IPAddress

Write-Host "Description : " $objItem.Description

write-host "DNS Servers in Order : " $objItem.DNSServerSearchOrder

Write-host "WINS Server Primary : " $objItem.WINSPrimaryServer

Write-Host "WINS Server Secondary : " $objItem.WINSSecondaryServer

Write-Host "DNSDomain : " $objItem.DNSDomain

Write-Host "DefaultIPGateway : " $objItem.DefaultIPGateway

write-host "MAC Address : " $objItem.MACAddress

write-host ""

write-host "--End-Network-Details-For-> $strComputer"

write-host ""



}

}



 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page