Sitemap

Amicuk Programming Answers

Script to ping multiple hosts and return domain info to a txt or csv file

-0001-11-30   Views:3

Advertisement

Hi, I wonder if anyone can help.  I need a script that will allow me to ping multiple hosts (all listed on seperate lines in a txt file) and return IP, server up\down and domain info to a txt or ideally a csv file. I'm sure this must have been done\r

Hi,
I wonder if anyone can help.  I need a script that will allow me to ping multiple hosts (all listed on seperate lines in a txt file) and return IP, server up\down and domain info to a txt or ideally a csv file.
I'm sure this must have been done\requested before but I can't seem to find the correct script anywhere
Thanks for your help
Mal

The replay answer
Advertisement
Try this modification:
[email protected]()
Get-Content p:\list.TXT | %{
$start_name = $_
$conn = Test-Connection -ComputerName $_ -Quiet
if(-not $conn)
$start_name = ""
Try
$dns = [System.Net.Dns]::GetHostEntry($_)
$dns_host = $dns.HostName
$dns_ip = $dns.AddressList | select -ExpandProperty IPAddressToString
catch
$dns_host = "invalid host name" #as jrich proposed :)
$dns_ip = "invalid host name" #as jrich proposed :)
$start_name = ""
$HostObj = New-Object PSObject -Property @{
Host = $start_name
IP = $dns_ip
DNSHost = $dns_host
Active = $conn
$result += $HostObj
$result | Export-Csv p:list.csv -NoTypeInformation

Go to See the other 13 answers

Script to ping multiple hosts and return domain info to a txt or csv file

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I wonder if anyone can help.  I need a script that will allow me to ping multiple hosts (all listed on seperate lines in a txt file) and return IP, server up\down and domain info to a txt or ideally a csv file. I'm sure this must have been done\r[More]

Explain the Batch script to ping multiple computers

Category:DefaultRelease time:-0001-11-30Views:130

Hello, Please comment and explain each liner of the script. @echo off if exist d:\tools\computers.txt goto Label1 echo. echo Cannot find d:\tools\computers.txt echo. Pause goto :eof :Label1 echo PingTest executed on %date% at %time% > d:\tools\z.txt[More]

How to Read the "text file and csv file" through powershell Scripts

Category:DefaultRelease time:2015-10-11Views:130

Hi All i need to add a multiple users in a particular Group through powershell Script how to read the text and CSV files in powershell am completly new to Powershell scripts any one pls respond ASAP.with step by step process pls Regards: Rajeshreddy.[More]

Modifying the script to include multiple domains

Category:DefaultRelease time:-0001-11-30Views:130

Hi, The below script will start the servers by connecting to node manager for a particular domain. How can I modify the below script to include multiple servers which are from multiple domains. from java.util import Properties from java.io import Fil[More]

Powershell script to add multiple domains to a transport rule

Category:DefaultRelease time:-0001-11-30Views:130

I have a transport rule in Exchange 2013 that I created in the EAC (mail flow>rules).  it is set so *Apply this rule if.. the sender's domain is..  and then I entered a few domains. I want to use a powershell script to enter multiple domains into the[More]

Script to tracert multiple computer names and find specifc text

Category:DefaultRelease time:2015-10-11Views:130

I'm looking for a script to tracert multiple servers and find a specific text in tracert output and get output as csv. Below is what I have: @ECHO OFF FOR /F %%S IN (SERVERS.TXT) DO ( ECHO %%S >> OUTPUT.LOG TRACERT %%S | Findstr "firewall -f-&q[More]

Script to merge multiple CSV files together with no duplicate records.

Category:DefaultRelease time:2015-10-11Views:130

I like a Script to merge multiple CSV files together with no duplicate records. None of the files have any headers and column A got a unique ID. What would be the best way to accomplish that?OK here is my answer : 2 files in a directory with no heade[More]

Selective IP filtering for multiple servers in a domain?

Category:DefaultRelease time:-0001-11-30Views:130

Is it possible to have IP filtering on for certain servers in a domain, and not for others? This is the situation: I am deploying two servers in mydomain, so let's call it serverA and serverB. I want serverA to accept all connections while serverB ac[More]

[PowerShell] Ping multiple servers simultaneously with PowerShell: Test-ConnectionAsync (strange problems)

Category:DefaultRelease time:-0001-11-30Views:130

I am hoping the author of the script "Ping multiple servers simultaneously with PowerShell: Test-ConnectionAsync" can help me. I found it at: https://gallery.technet.microsoft.com/scriptcenter/Multithreaded-PowerShell-0bc3f59b I am using the ver[More]

We have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc. from some day's When we facing problem when we are access from host name that shared folder is accessible but same time same computer when

Category:DefaultRelease time:2015-10-11Views:130

Hello All, we have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc. from some day's When we facing problem when we are access from host name that shared folder is accessible but same time sa[More]

How to configure multiple smtp servers per domain

Category:DefaultRelease time:2015-10-11Views:130

Hi, how do we configure multiple smtp servers per domain/corporate in iplanet messaging server 5.2. i wanted to do this so that i can configure some domains with virus scanning and some domains without antivirus.Hi Martin, Well we are trying to run a[More]

Hot
Hi all, I try to add a monitor for HP-UX system. When i trying to start the script, wls_oats.log include: 11:23:07,054 DEBUG [SessionIOForm] oracle.oats.olt.OracleFormBase.debug(OracleFormBase.java:66) Constructor 11:23:07,054 INFO [RunAutoPilotActio [More]
Hello, I have a 2911 Router with IOS Security and Voice enabled and we are using CME 8.6.  I am using a built-in Anyconnect VPN on 3 phones that are for remote users and thus I needed to enable security zones on the router which works because the rem [More]
I just bought and downloaded 5 Pixar short subject movies. I have a 3 year old grandson that I've set up a Mac for. I've put his favorite movies and trailers on the desktop with large icons and slow double click. I set each movie to open in full scre [More]
I have a WRT54g router. Everything works great for a period of time even after turning the computer, internet modem and router on and off several times. Then I turn everything on and the computer does not connect to the internet. It go and connect th [More]
In Solution Manager 4.0, we have configured the CCMSPING agent to monitor a number of systems.  For only two of those systems, CCMSPING is not collecting "Dialog Response Time" (Availability_DiaRespTime) and "Standardized Response Time" [More]
Got a used Mac last week and the previous owner had it wiped, but it looks like it was cleaned out too thoroughly. Upon the first restart after taking possession of the computer, it booted to the Mountain Lion OS X Utilities screen. I'm not sure whic [More]
IiMessage activation error occurred during activation after updating to iOS 8.  I have gone into setting to enter password.  I have no other issues with my password in any other applicationsThe problem might be that your Apple ID is not added in your [More]
All the past and future Mac Notebooks allowed memory upgrades when the chips either became available or affordable. The Apple store advisor (when I purchased last year) said that like older Mac Notebooks they assumed that the MBP memory would be upgr [More]
Dear Colleagues Has anyone come accross the following error: No expenditure items found Message no. VPK1310 Diagnosis No expenditure items matching the selection were found. System Response No processing possible. Procedure Resource-related billing c [More]
Hello, Does anyone know what functions the RunTime engine supports? Or is there a NI link I can follow. Some goodies like the VI server don't seem to be supported in RTE 5.1. 6i any different? Thanks MartinI know about the paths, but I had problems w [More]