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
I have an iPhone and I'll come across a song that I don't want to hear anymore. I'll delete it off my phone and then when I charge my phone it shows up again!!! On the desktop iTunes I can "uncheck" a song and it won't be played in iTunes. How d [More]
Hi,         When i run the Adobe intractive form,i am getting following exception "Error when converting a numeric field to XML" Anyone plz suggest Regards, vinothHi Vinoth Raja, For resolving the following exception "Error when converting [More]
Hi all, I am attempting to deploy a war file on Oracle 9i's Apache JServ. The docs from Oracle are immense and I haved searched them to no avail. Does anyone know how to deploy a war file(that I have created with netbeans) to JServ? Specifically what [More]
Hey, So I'm working on a DVD video for my nan's funeral and I opened the project and my edited sequence is no longer in the time line! I click on it but nothing shows up. It's as if I haven't done any editing in it yet. But I have and I have saved it [More]
Have just purchased Satellite C50 D but cannot get it to read or recognise my LaCie hard drive. As this has all the data from my previous computer it is rather important. Can anyone provide help and guidance as to how to a) read the drive or b) trans [More]
Hi all, I am a new user of Photoshop CS5.1 Extended and have a question about Mini Bridge. My OS is Windows 7 Ultimate 64-bit, and I'm using the 64-bit version of Photoshop. My question is: how do I clear the Recent Files and Recent Folders lists fro [More]
CODE public class Domtest { public static void main(String[] args) {      String resDir = "c:\\res\\";      Document doc = null;      try{      File docFileIn =new File("c:\\test\\test3.jdf");      DocumentBuilderFactory dbf = Document [More]
I have a HP machine with this mother board. I think it is running bios 5.16. I am trying to find the 5.22 update as i am looking at upgrading the CPU to a e8400. I am running windows 7 32bit and the only update i have been able to find is for VISTA. [More]
I know there is a way to create a hibernate .hbm.xml file and the corresponding .java class automatically from a previously created DB table. Do you know how? Any Eclipse plug-in?Specifically: http://www.hibernate.org/255.html The Eclipse stuff's eas [More]
Hi All, Good Morning, I completed the dep.run for the year 2008. after this i did the year end activity through AJAB and then tried to change the fiscal year through AJRW. In the Test run showing successfully without any errors with green light, but [More]