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
Hello All, This is my first post to this community. I would not be surprised if the answer to my question can be found in a simple search or tutorial. However, I assure you that I have been searching, clicking, reading and even attempting to install [More]
to try out but get an error that the program is wrongly configured. How do I proceed?Hi Charlotta , Please refer to the following link to download Acrobat. https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html Let us know with your feedback. Rega [More]
I'd like to set up guest access to my E2000 router, but only for a few friends, not my entire neighborhood. When I set everything up originally through Cisco Connect, I was able to set up a guest account with a password, but it's showing up in my wir [More]
Hi , Below query is taking more time (4mins) for 41 rows returning and there is no full table scan .Can some one help to rewrite the query. SELECT           esma.candidate AS candidate_additional_sample,           ccr.raw_mark,           ccr.split_se [More]
Hi All, I want to extract a column which contain long raw data (pdf file) into files on my disque, but i don't know how to do it in SQL or PL/SQL, any help ???Or maybe just an alter table statement will do it for you... SQL> create table xx (x long r [More]
I use JDevelop to develop my JSP apps with BC4J. When I Run a JSP app, the error happened. The error message is [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. Who can tell me what the erro [More]
I use my account for everything, but when I want to update my apps, it shows me my cousins account. How do I delete his account and then use mine? It's on a iPhone 5Settings > iTunes and App Stores > Apple ID = Sign Out... Then Sign In using the pre [More]
jsf code <h:dataTable value="#{EmpBean.lDocumentos}" var="TBean" id="TablaDoc"> <h:column> <f:facet name="header"> <h:outputText value="N�mero"/> </f:facet> <h:outputText v [More]
I have an iBook G4 with the original operating system 10.2.something. I have already uploaded the highest adobe reader as I can (7.0) with my OS. I have a PC from work that I uploaded some PDF's onto a flash drive. When I brought the flash drive home [More]
Hi, I would like to use SSL to secure the communications channel for a webservice that has been created in the SOA Suite via BPEL. Is this normally achieved via the WSM? Do any whitepapers or guides exist as to what best practice is? Thanks in Advanc [More]