{"id":1738,"date":"2011-11-07T09:40:50","date_gmt":"2011-11-07T14:40:50","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1738"},"modified":"2014-04-25T11:39:25","modified_gmt":"2014-04-25T15:39:25","slug":"ping-ip-range","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/","title":{"rendered":"Ping IP Range"},"content":{"rendered":"<p>Last week I came across a post on using PowerShell, or more specifically a .NET Framework class, to ping a range of computers in an IP subnet. The original post by Thomas Maurer is <a href=\"http:\/\/www.thomasmaurer.ch\/2011\/11\/powershell-ping-ip-range\/\" target=\"_blank\">here<\/a>. I added a comment. And after looking at this again I decided to take the ball and run with it a bit further. I'm a big proponent of PowerShell tools that are object oriented and that can add real value to the pipeline. To that end I wrote Test-Subnet. <!--more--><\/p>\n<p>My function is essentially a wrapper for the Test-Connection cmdlet. By using the cmdlet, I can take advantage of some built in parameters such as the number of pings to send, buffer size and time to live. I'm also going to take advantage of the -Quiet parameter which will return a simple True\/False depending on whether the address can be pinged. Here's what the code looks like.<\/p>\n<pre class=\"lang:ps decode:true \" >Function Test-Subnet {\r\n[cmdletbinding()]\r\n\r\nParam (\r\n[Parameter(Position=0)]\r\n[ValidatePattern(\"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\")]\r\n[string]$Subnet=\"172.16.10\",\r\n[Parameter(Position=1)]\r\n[int[]]$Range=1..254,\r\n[int]$Count=1,\r\n[int]$Delay=1,\r\n[int]$Buffer=32,\r\n[int]$TTL=80,\r\n[switch]$AsJob\r\n)\r\n\r\nWrite-Verbose \"Testing $subnet\"\r\n#define a scriptblock we can run as a job if necessary\r\n$sb={\r\nParam($range,$subnet,$count,$delay,$buffer,$ttl)\r\n$range | foreach {\r\n    $target=\"$subnet.$_\"\r\n    Write-verbose $target\r\n    $ping=Test-Connection -ComputerName $target -count $count -Delay $delay -BufferSize $Buffer -TimeToLive $ttl -Quiet\r\n    New-Object -TypeName PSObject -Property @{\r\n        IPAddress=$Target\r\n        Pinged=$ping\r\n        TTL=$TTL\r\n        Buffersize=$buffer\r\n        Delay=$Delay\r\n        TestDate=Get-date\r\n    }\r\n}\r\n} #close scriptblock\r\n\r\nif ($AsJob) {\r\n    Write-Verbose \"Creating a background job\"\r\n    Start-Job -ScriptBlock $sb -Name \"Ping $subnet\" -ArgumentList $range,$subnet,$count,$delay,$buffer,$ttl\r\n}\r\nelse {\r\n #run the command normally\r\n Invoke-Command -ScriptBlock $sb -ArgumentList $range,$subnet,$count,$delay,$buffer,$ttl\r\n}\r\n\r\n} #end function<\/pre>\n<p>This is an advanced function. The download file includes comment based help. The main part of the script takes the range of host numbers and pipes them to a foreach construct.<\/p>\n<pre class=\"lang:ps decode:true \" >$range | foreach {\r\n    $target=\"$subnet.$_\"<\/pre>\n<p>Each number in the range is \"added\" to the subnet to come up with target IP.  So if the range is 1..5 and the subnet is 192.16.10 each time through I'll get targets 192.168.10.1 through 192.168.10.5. This address is passed to Test-Connection along with the other values from my function.<\/p>\n<pre class=\"lang:ps decode:true \" >$ping=Test-Connection -ComputerName $target -count $count -Delay $delay -BufferSize $Buffer -TimeToLive $ttl -Quiet\r\n<\/pre>\n<p>Then for each target address, I use the New-Object cmdlet to create a custom object. The -Property parameter is a hash table that will be used as properties for the custom object.<\/p>\n<pre class=\"lang:ps decode:true \" > New-Object -TypeName PSObject -Property @{\r\n        IPAddress=$Target\r\n        Pinged=$ping\r\n        TTL=$TTL\r\n        Buffersize=$buffer\r\n        Delay=$Delay\r\n        TestDate=Get-date\r\n    }<\/pre>\n<p>Most of these values are taken from the function's input values. Although I added a TestDate property to capture the current date and time in the event that you saving your ping results for later review.<\/p>\n<p>The function could have been a simple wrapper but I took it a step further and added my own support to run it as a background job. The Test-Connection cmdlet has an -AsJob parameter. I could have structured my function to use it, but I wanted to show how you might add AsJob support for commands that don't support it natively. <\/p>\n<p>The extra step you need is to turn your core command into a script block. Script blocks can accept parameters which I need to use. Otherwise, the variables wouldn't get resolved because of scope.<\/p>\n<pre class=\"lang:ps decode:true \" >$sb={\r\nParam($range,$subnet,$count,$delay,$buffer,$ttl)\r\n$range | foreach {\r\n    $target=\"$subnet.$_\"\r\n    Write-verbose $target\r\n    $ping=Test-Connection -ComputerName $target -count $count -Delay $delay -BufferSize $Buffer -TimeToLive $ttl -Quiet\r\n    New-Object -TypeName PSObject -Property @{\r\n        IPAddress=$Target\r\n        Pinged=$ping\r\n        TTL=$TTL\r\n        Buffersize=$buffer\r\n        Delay=$Delay\r\n        TestDate=Get-date\r\n    }\r\n}\r\n} #close scriptblock\r\n<\/pre>\n<p>If I don't specify -AsJob, I'll run the script block using Invoke-Command and pass it a list of arguments.<\/p>\n<pre class=\"lang:ps decode:true \" >Invoke-Command -ScriptBlock $sb -ArgumentList $range,$subnet,$count,$delay,$buffer,$ttl<\/pre>\n<p>But if I use -Asjob, then I'll pass the scriptblock to the Start-Job cmdlet.<\/p>\n<pre class=\"lang:ps decode:true \" >if ($AsJob) {\r\n    Write-Verbose \"Creating a background job\"\r\n    Start-Job -ScriptBlock $sb -Name \"Ping $subnet\" -ArgumentList $range,$subnet,$count,$delay,$buffer,$ttl\r\n}<\/pre>\n<p>Later I can retrieve the results and then slice and dice as much as I need to. The key takeaway is to always be thinking about objects in the pipeline.  <\/p>\n<p>For example, here I'm going to ping 192.168.10.100 through 192.168.10.200 and save the IP addresses that fail to a text file.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; Test-Subnet 192.168.10 (100..200) | where {! $_.Pinged} | Select -expand IPAddress | out-file c:\\work\\ipfail.txt<\/pre>\n<p>Or maybe something like this where we pass the IP address to Get-WMIobject.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; test-subnet -range (1..10) | where {$_.pinged} | \r\n&gt;&gt; foreach {get-wmiobject win32_operatingsystem -comp $_.IPAddress} | \r\n&gt;&gt; Select CSName,Caption\r\n&gt;&gt;\r\n<\/pre>\n<p>I trust you get the idea.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/11\/Test-Subnet.txt' target='_blank'>Test-Subnet<\/a> and let me know what you think.<\/p>\n<p>UPDATE: A newer version of this function can be found at http:\/\/bit.ly\/QLDJVX<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I came across a post on using PowerShell, or more specifically a .NET Framework class, to ping a range of computers in an IP subnet. The original post by Thomas Maurer is here. I added a comment. And after looking at this again I decided to take the ball and run with it&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,75],"tags":[122,202,190,144,332,534,540,333,174],"class_list":["post-1738","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-v2-0","tag-invoke-command","tag-jobs","tag-new-object","tag-objects","tag-ping","tag-powershell","tag-scripting","tag-start-job","tag-test-connection"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ping IP Range &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ping IP Range &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Last week I came across a post on using PowerShell, or more specifically a .NET Framework class, to ping a range of computers in an IP subnet. The original post by Thomas Maurer is here. I added a comment. And after looking at this again I decided to take the ball and run with it...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-07T14:40:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-04-25T15:39:25+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Ping IP Range\",\"datePublished\":\"2011-11-07T14:40:50+00:00\",\"dateModified\":\"2014-04-25T15:39:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/\"},\"wordCount\":531,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Invoke-Command\",\"Jobs\",\"new-object\",\"objects\",\"Ping\",\"PowerShell\",\"Scripting\",\"Start-Job\",\"Test-Connection\"],\"articleSection\":[\"PowerShell\",\"PowerShell v2.0\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/\",\"name\":\"Ping IP Range &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-11-07T14:40:50+00:00\",\"dateModified\":\"2014-04-25T15:39:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1738\\\/ping-ip-range\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ping IP Range\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ping IP Range &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/","og_locale":"en_US","og_type":"article","og_title":"Ping IP Range &#8226; The Lonely Administrator","og_description":"Last week I came across a post on using PowerShell, or more specifically a .NET Framework class, to ping a range of computers in an IP subnet. The original post by Thomas Maurer is here. I added a comment. And after looking at this again I decided to take the ball and run with it...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-11-07T14:40:50+00:00","article_modified_time":"2014-04-25T15:39:25+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Ping IP Range","datePublished":"2011-11-07T14:40:50+00:00","dateModified":"2014-04-25T15:39:25+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/"},"wordCount":531,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Invoke-Command","Jobs","new-object","objects","Ping","PowerShell","Scripting","Start-Job","Test-Connection"],"articleSection":["PowerShell","PowerShell v2.0"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/","name":"Ping IP Range &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-11-07T14:40:50+00:00","dateModified":"2014-04-25T15:39:25+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1738\/ping-ip-range\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Ping IP Range"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3830,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3830\/test-subnet-with-powershell\/","url_meta":{"origin":1738,"position":0},"title":"Test Subnet with PowerShell","author":"Jeffery Hicks","date":"April 25, 2014","format":false,"excerpt":"A few years ago I published a PowerShell function to test IP addresses on a given subnet. I had an email the other day about it and I decided to refresh it. My new version adds a few bells and whistles that I think you might like. For example, you\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"keyboardanalyze","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/07\/keyboardanalyze-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1855,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1855\/test-subnet-winform\/","url_meta":{"origin":1738,"position":1},"title":"Test-Subnet WinForm","author":"Jeffery Hicks","date":"November 21, 2011","format":false,"excerpt":"Recently, I posted an entry on how to ping an IP subnet with PowerShell. Using objects in the PowerShell pipeline is a good thing. But sometimes we want a GUI and I figured the ping subnet script would make a good WinForm script. When creating graphical PowerShell scripts, I always\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/11\/subnetpingform-300x178.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1923,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1923\/send-powershell-reports-by-mail\/","url_meta":{"origin":1738,"position":2},"title":"Send PowerShell Reports by Mail","author":"Jeffery Hicks","date":"December 29, 2011","format":false,"excerpt":"Today I came across a post about pinging a list of computers and send the results as a table via Outlook. Brian is a very smart Active Directory guy so I offered some PowerShell suggestions to make his task even easier. Obviously you can only offer so much in a\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/html-mail-300x192.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":606,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/606\/test-connection-troubles\/","url_meta":{"origin":1738,"position":3},"title":"Test Connection Troubles","author":"Jeffery Hicks","date":"March 24, 2010","format":false,"excerpt":"In this week\u2019s Prof. PowerShell column, I have an article on using the Test-Connection in Windows PowerShell. I thought it was pretty straightforward, but I didn\u2019t take problems into account. I received an email asking what to do about error messages. For example, what if you have a computername in\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":346,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/346\/powershell-exit-stage-left\/","url_meta":{"origin":1738,"position":4},"title":"Powershell: Exit Stage Left","author":"Jeffery Hicks","date":"September 1, 2009","format":false,"excerpt":"While reviewing and revising the manuscript for Windows PowerShell v2.0: TFM 3rd ed. I had the opportunity to revisit our chapter on working with events in PowerShell. An event in Windows is when something happens like a mouse-click, a process being created or window resized. In PowerShell you can easily\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4000,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4000\/using-optimized-text-files-in-powershell\/","url_meta":{"origin":1738,"position":5},"title":"Using Optimized Text Files in PowerShell","author":"Jeffery Hicks","date":"September 8, 2014","format":false,"excerpt":"If you are like many IT Pros that I know, you often rely on text files in your PowerShell work. How many times have you used a text file of computernames with Get-Content and then piped to other PowerShell commands only to have errors. Text files are convenient, but often\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"document","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/document.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1738"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1738\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}