
Ping a list of host names and output the results to a csv in powershell
Using a list of computers and -asjob works very well. The Responsetime property (confusingly the header is "Time (ms)") will be non-null if the host is up. Lately I do it this way. It requires threadjobs installed in powershell 5.1. Or just use get-port. I stick it in a mymod\mymod.psm1 module file somewhere in $env:psmodulepath.
Read Computer Names from Text File and Execute a Command
Apr 22, 2015 · $GetID = Read-Host "What is the Device ID?" Write-Host("$Computer") What this does is prompt the tech for the host name and gives the results. How can I have the script prompt the tech for a path to a text file and then have the script give a list of results from that text file? $TextFilePath = Read-Host "What is the path to the text file?"
Getting IP addresses for hostnames using nslookup in Powershell
I have a list of server hostnames and I need to get IP addresses of those servers and write the results in a file. The hostnames are one column in Excel spreadsheet but I can format them into anything (csv, simple txt file with one hostname per line etc.).
help with script to read a list of computers from .txt and run …
Oct 1, 2019 · Hello, I am trying to write a script that will look at a file c:\computers.txt for a list of computers to run against. To start a ping on the computers in the list make sure the computer is on 1 then run a command on …
How to Ping List of Host Names and Output Results to CSV in PowerShell
Mar 11, 2025 · In this tutorial, we will explore how to ping a list of host names and output the results to a CSV file using PowerShell. Whether you are a network administrator or a tech enthusiast, this guide will equip you with the tools to streamline your network checks.
How to read host files with PowerShell: Local & remote - PDQ
Apr 26, 2017 · Reading the hosts file with PowerShell is a breeze. In order to do this, we are going to make use of the Get-Content cmdlet. This cmdlet will read the contents of a file. If you only need to quickly see the entire contents of the hosts file, then this super simple one-liner should do the trick:
PowerShell: Resolve IP address to name and export to CSV
Oct 16, 2019 · The script that we are going to discuss will read a list of IP addresses from a text file, resolves them to hostnames, and finally exports them to CSV file. We are going to use [System.Net.DNS] DotNet class for this purpose.
PowerShell - Read File with Hostnames and Perform Task
Aug 9, 2014 · PowerShell quick reference on how to read a file with hostnames and perform a function or task. Ping hostnames, Get Registry values, Get Systems UpTimes.
powershell - Powsershell reading server list from a text file
Feb 12, 2016 · $Server = Get-Content C:\servers.txt Get-WmiObject -Class Win32_PerfFormattedData_PerfOS_System -ComputerName $Server | Select-Object @{Name = “ComputerName”; Expression = {$_.__SERVER}}, @{Name = “SystemUpTime”; Expression = {New-TimeSpan -Seconds $_.SystemUpTime}}| Export-CSV C:\test2.txt.
Powershell Script to pull domain computers from a .txt list using …
Mar 30, 2023 · If so how to have it look at each entry in the .txt file separately? Here is the script. $Computers = Get-Content c:\ADClean\computers.txt. ForEach ($Computer in $Computers) { $ADComputer = $null $ADComputer = Get-ADcomputer -Filter * | Where-Object {$_.Name -like "$Computers" } | Select -Property Name | export-csv c:\ADClean\computersfound.txt ...