{"id":5275,"date":"2016-10-06T08:31:02","date_gmt":"2016-10-06T12:31:02","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=5275"},"modified":"2017-01-14T10:52:46","modified_gmt":"2017-01-14T15:52:46","slug":"managing-lmhosts-with-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/","title":{"rendered":"Managing LMHosts with PowerShell"},"content":{"rendered":"<p>I've been in IT for a long time. It has been exciting to see how the industry has changed and how it as adapted to new technologies. Even so, I appreciate situations where sometimes the \"old ways\" are still the best ways. For example, we no longer really need the ancient lmhosts file to help resolve NETBIOS names to IP addresses.\u00a0 However, there may be a few cases where lmhosts solves a problem and then wouldn't it be nice to manage it with PowerShell?<\/p>\n<p><!--more--><\/p>\n<p>I've been working on a project related to automating my teaching environment using Hyper-V and DSC. One of the tasks requires using remoting to connect to the new virtual machine, but the machine is on a private, NAT'd network so name resolution is sometimes an issue. This is where PowerShell Direct is so useful as it allows you to establish a remoting session over the VM bus. However, for now this only works from a Windows Server 2016 Hyper-V host to a Windows 10 or Windows Server 2016 virtual machine.<\/p>\n<p>So I make sure my VMs have an IPAddress which I can then use with <a title=\"Read online help for this command\" href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=135237\" target=\"_blank\">New-PSSession<\/a>. But at some point I realized I wanted to use the computer name, hence the name for quick and dirty name resolution.\u00a0 That's a lot of back story which is probably irrelevant.<\/p>\n<p>The lmhosts file is a plain text file that resides in C:\\Windows\\System32\\Drivers\\etc and is call lmhosts without any extension. You most likely don't have one although you will see a lmhosts.sam file which serves as a template. Essentially the file is a text list of IP address and computername.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">172.16.30.200\tchi-dc01\r\n172.16.30.201\tchi-dc02\r\n172.16.30.203 \tchi-dc04\r\n172.16.30.212  \tchi-hvr2\r\n<\/pre>\n<p>What I wanted was a PowerShell way to manage this file. I created a simple module called MyLmhost. It has 3 simple commands.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png\" alt=\"image\" width=\"644\" height=\"127\" border=\"0\" \/><\/a><\/p>\n<p>The commands use a combination of <a title=\"Read online help for this command\" href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=113310\" target=\"_blank\">Get-Content<\/a> with regular expressions to parse out the IP address and computer name and creates objects.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb-1.png\" alt=\"image\" width=\"644\" height=\"389\" border=\"0\" \/><\/a><\/p>\n<p>I can easily create new entries:<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb-2.png\" alt=\"image\" width=\"644\" height=\"108\" border=\"0\" \/><\/a><\/p>\n<p>If the entry doesn't exist it will be added, otherwise this command will update the entry with the new IP address or name. And of course I can remove an entry.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb-3.png\" alt=\"image\" width=\"644\" height=\"91\" border=\"0\" \/><\/a><\/p>\n<p>Whenever you make a change to the file it will create a backup copy. The backup copy keeps getting overwritten every time you make a change.<\/p>\n<p>I imagine many of you may not have a practical need for this module, but you may find the code educational. You can find it on Github at <a title=\"https:\/\/github.com\/jdhitsolutions\/Mylmhost\" href=\"https:\/\/github.com\/jdhitsolutions\/Mylmhost\" target=\"_blank\">https:\/\/github.com\/jdhitsolutions\/Mylmhost<\/a>.\u00a0\u00a0 If you have any questions or problems, post an issue in the GitHub repository.<\/p>\n<p>Enjoy!<\/p>\n<p><strong>Update<\/strong>: You can find the module on the PowerShell Gallery. Run Install-Module mylmhost.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been in IT for a long time. It has been exciting to see how the industry has changed and how it as adapted to new technologies. Even so, I appreciate situations where sometimes the &#8220;old ways&#8221; are still the best ways. For example, we no longer really need the ancient lmhosts file to help&#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":"New from the blog: Managing LMHosts with #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[499,4,8],"tags":[534,540],"class_list":["post-5275","post","type-post","status-publish","format-standard","hentry","category-github","category-powershell","category-scripting","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Managing LMHosts with PowerShell &#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\/5275\/managing-lmhosts-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Managing LMHosts with PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been in IT for a long time. It has been exciting to see how the industry has changed and how it as adapted to new technologies. Even so, I appreciate situations where sometimes the &quot;old ways&quot; are still the best ways. For example, we no longer really need the ancient lmhosts file to help...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-06T12:31:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-14T15:52:46+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Managing LMHosts with PowerShell\",\"datePublished\":\"2016-10-06T12:31:02+00:00\",\"dateModified\":\"2017-01-14T15:52:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/\"},\"wordCount\":452,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/image_thumb.png\",\"keywords\":[\"PowerShell\",\"Scripting\"],\"articleSection\":[\"GitHub\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/\",\"name\":\"Managing LMHosts with PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/image_thumb.png\",\"datePublished\":\"2016-10-06T12:31:02+00:00\",\"dateModified\":\"2017-01-14T15:52:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/image_thumb.png\",\"width\":644,\"height\":127},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5275\\\/managing-lmhosts-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"GitHub\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/github\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Managing LMHosts with PowerShell\"}]},{\"@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":"Managing LMHosts with PowerShell &#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\/5275\/managing-lmhosts-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Managing LMHosts with PowerShell &#8226; The Lonely Administrator","og_description":"I've been in IT for a long time. It has been exciting to see how the industry has changed and how it as adapted to new technologies. Even so, I appreciate situations where sometimes the \"old ways\" are still the best ways. For example, we no longer really need the ancient lmhosts file to help...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2016-10-06T12:31:02+00:00","article_modified_time":"2017-01-14T15:52:46+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Managing LMHosts with PowerShell","datePublished":"2016-10-06T12:31:02+00:00","dateModified":"2017-01-14T15:52:46+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/"},"wordCount":452,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png","keywords":["PowerShell","Scripting"],"articleSection":["GitHub","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/","name":"Managing LMHosts with PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png","datePublished":"2016-10-06T12:31:02+00:00","dateModified":"2017-01-14T15:52:46+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/10\/image_thumb.png","width":644,"height":127},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5275\/managing-lmhosts-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"GitHub","item":"https:\/\/jdhitsolutions.com\/blog\/category\/github\/"},{"@type":"ListItem","position":2,"name":"Managing LMHosts with PowerShell"}]},{"@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":4918,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4918\/get-local-group-members-revisited\/","url_meta":{"origin":5275,"position":0},"title":"Get Local Group Members Revisited","author":"Jeffery Hicks","date":"February 18, 2016","format":false,"excerpt":"The other day I posted an article and function that used ADSI and PowerShell to list members of a local group. I had a few people report an unusual error that I couldn't replicate. During the course of troubleshooting, I made a few changes to the original function to at\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-9.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-9.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-9.png?resize=525%2C300 1.5x"},"classes":[]},{"id":7361,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/7361\/powershell-7-cross-platform-scripting-tips-and-traps\/","url_meta":{"origin":5275,"position":1},"title":"PowerShell 7 Cross-Platform Scripting Tips and Traps","author":"Jeffery Hicks","date":"March 13, 2020","format":false,"excerpt":"One of the reasons you want to adopt PowerShell 7 on your desktop, is that it can\u00a0 be used cross-platform. Theoretically, you can write a PowerShell script or function that works on Windows, Linux, and Mac. However, this is not without challenges. In some ways, it feels like we are\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1454,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1454\/teched-atlanta-managing-the-registry-with-powershell\/","url_meta":{"origin":5275,"position":2},"title":"TechEd Atlanta &#8211; Managing the Registry with PowerShell","author":"Jeffery Hicks","date":"May 23, 2011","format":false,"excerpt":"My second TechEd talk was about managing the registry with Windows PowerShell. If you were in the session you know that I stressed heavily using the PowerShell provider and cmdlets. For remote computers, leverage PowerShell's remoting infrastructure. But I also discussed using the \"raw\" .NET classes as well as WMI\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5895,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5895\/another-look-at-powershell-core-version-information\/","url_meta":{"origin":5275,"position":3},"title":"Another Look at PowerShell Core Version Information","author":"Jeffery Hicks","date":"February 8, 2018","format":false,"excerpt":"As PowerShell Core begins to spread into our world, and as we start thinking about working and scripting cross-platform, it will be useful to know what type of platform you are running on. The built in $PSVersionTable is an obvious place to start. On PowerShell Core there are also some\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\/2018\/02\/image_thumb-5.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-5.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":7458,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/","url_meta":{"origin":5275,"position":4},"title":"A PowerShell Remote Function Framework","author":"Jeffery Hicks","date":"May 8, 2020","format":false,"excerpt":"The other day I shared a PowerShell function to query the registry on remote computers to find installed versions of PowerShell. The function leveraged PowerShell remoting with the flexibility of using a computer name with an optional credential or existing PSSessions. The more I thought about it, the more I\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\/2020\/05\/stop-remoteprocess.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":347,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/347\/winrm-domain-or-workgroup\/","url_meta":{"origin":5275,"position":5},"title":"WinRM: Domain or Workgroup?","author":"Jeffery Hicks","date":"September 11, 2009","format":false,"excerpt":"I'm curious about something and would like to hear from you. PowerShell v2 remoting uses WinRM which in a domain environment is very secure and easy to use. You can even use a GPO to configure your domain members. However you can also use WinRM in a workgroup environment but\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5275","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=5275"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5275\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}