{"id":6586,"date":"2019-03-26T13:44:03","date_gmt":"2019-03-26T17:44:03","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=6586"},"modified":"2019-03-26T13:44:09","modified_gmt":"2019-03-26T17:44:09","slug":"powershell-remoting-sessions-and-containers","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/","title":{"rendered":"PowerShell Remoting Sessions and Containers"},"content":{"rendered":"<p>This year I've been ramping up my work with containers via the Docker Desktop application. When Windows Server 2016 was in preview Microsoft tried out some PowerShell cmdlets for working with containers but they never went anywhere. Essentially, the docker command line has become the defacto management tool. There are some modules in the PowerShell Gallery that I've seen but I think many of them are wrappers for the docker commands.\u00a0 For now I'll stick with learning docker. Eventually, if I move to a PowerShell tool I'll have a solid understanding of the underlying technology.\u00a0 One of those challenges was figuring out PowerShell remoting with a Windows server container.<\/p>\n<p><!--more--><\/p>\n<h2>Creating a Container<\/h2>\n<p>I've already pulled the official microsoft\/windowserver image from docker on my Windows 10 desktop. I then created a new network so that I have more control over the container I intend to create.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">docker network create --driver nat --internal --subnet 192.168.4.0\/24 company\n<\/pre>\n<p>I then created a container assigning an IP address and host name.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">docker container create --name srv4 --interactive --dns 1.1.1.1 --network company --memory (2gb) --ip 192.168.4.20 --hostname SRV4 microsoft\/windowsservercore\n\ndocker start srv4<\/pre>\n<p>At this point, the container is running. I can ping it just fine.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Ping a docker container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb.png\" alt=\"Ping a docker container\" width=\"931\" height=\"341\" border=\"0\" \/><\/a><\/p>\n<h2>Configuring the Container<\/h2>\n<p>Next, I decided to update the image. I have no idea what the administrator is, but using docker I can run commands to add a new local administrator account.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">docker exec srv4 net user localadmin P@ssw0rd \/add\ndocker exec srv4 net localgroup administrators localadmin \/add\n<\/pre>\n<p>You might also need to adjust your trusted hosts setting to allow remoting access to the container name or IP address. You might also want to add an entry in an LMHOSTS file to facilitate name resolution. From all appearances, this looks promising.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Testing a WSMan connection to a docker container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-1.png\" alt=\"Testing a WSMan connection to a docker container\" width=\"1028\" height=\"195\" border=\"0\" \/><\/a><\/p>\n<h2>Connecting to the Container<\/h2>\n<p>Because I have a local admin account it is simple to set up a CIMSession and use it to query the container.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$cs = new-cimsession -ComputerName 192.168.4.20 -Credential localadmin\n<\/pre>\n<p>Most cmdlets that have a Cimsession parameter should work just fine.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Querying a container with a CIMSession\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-2.png\" alt=\"Querying a container with a CIMSession\" width=\"1028\" height=\"272\" border=\"0\" \/><\/a><\/p>\n<p>Excellent. So a PSSession should work as well.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Failed PSSession to a docker container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-3.png\" alt=\"Failed PSSession to a docker container\" width=\"1028\" height=\"146\" border=\"0\" \/><\/a><\/p>\n<p>This puzzled me. I used the same credential for the Cimsession with no error. This is where you need to remember that a container is not a virtual machine. It is not a complete server with a full operating system. In looking at the help I discovered there is a parameter for a container id. Those of you who have been to one of my conference sessions or classes know that I am always talking about the importance of reading and re-reading help. Here's a great example.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Container help\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-4.png\" alt=\"Container help\" width=\"1028\" height=\"63\" border=\"0\" \/><\/a><\/p>\n<h2>Connecting a Container PSSession<\/h2>\n<p>This seems pretty straightforward. I've seen the container id with the docker ps command.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Getting the container id\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-5.png\" alt=\"Getting the container id\" width=\"1028\" height=\"211\" border=\"0\" \/><\/a><\/p>\n<p>For now, I'll just copy and paste and try the new syntax.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Failed to find docker container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-6.png\" alt=\"Failed to find docker container\" width=\"1028\" height=\"170\" border=\"0\" \/><\/a><\/p>\n<p>Again, I was puzzled and had to resort to reading a bit more about the docker commands. That's when I learned that the container ID is actually a much longer value. The docker ps command is giving me a truncated version. I needed to tell docker to give me the full value.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Getting the full container id\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-7.png\" alt=\"Getting the full container id\" width=\"1028\" height=\"153\" border=\"0\" \/><\/a><\/p>\n<p>That's a lot of type and copying and pasting obviously won't scale. Fortunately, I found a docker command to display only the id.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$id = docker container ls -q --no-trunc\n<\/pre>\n<p>In my case, this works just fine because I only have 1 container running. Eventually, I'll need to find a better way that scales. But for now, let's try this out.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Connecting a PSSession to a docker container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-8.png\" alt=\"Connecting a PSSession to a docker container\" width=\"1028\" height=\"323\" border=\"0\" \/><\/a><\/p>\n<p>It isn't a speedy connection but it works. As you can see I am connected using the container administrator account. Once I have the container ID I can also use it with <a title=\"Read online help for this command\" href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=135225\" target=\"_blank\" rel=\"noopener noreferrer\">Invoke-Command<\/a>.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Invoking a command in a container\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-9.png\" alt=\"Invoking a command in a container\" width=\"1028\" height=\"182\" border=\"0\" \/><\/a><\/p>\n<p>I'm not sure there's much more value here over using the native docker exec command.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image-10.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Running a PowerShell command with docker exec\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-10.png\" alt=\"Running a PowerShell command with docker exec\" width=\"1028\" height=\"179\" border=\"0\" \/><\/a><\/p>\n<p>Using Invoke-Command took 14 seconds and the docker command took 11. Still, it's nice to know how to connect and use a PSSession to a docker container if I need it.<\/p>\n<p>Have you been diving into containers? Trying to integrate your PowerShell work? What have you learned? What are the gotchas? I know I'd love to hear about them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This year I&#8217;ve been ramping up my work with containers via the Docker Desktop application. When Windows Server 2016 was in preview Microsoft tried out some PowerShell cmdlets for working with containers but they never went anywhere. Essentially, the docker command line has become the defacto management tool. There are some modules in the PowerShell&#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 Lonely Administrator: #PowerShell Remoting Sessions and #Docker #Containers","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":[600,4],"tags":[601,534,87],"class_list":["post-6586","post","type-post","status-publish","format-standard","hentry","category-docker","category-powershell","tag-containers","tag-powershell","tag-remoting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.\" \/>\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\/6586\/powershell-remoting-sessions-and-containers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-26T17:44:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-26T17:44:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell Remoting Sessions and Containers\",\"datePublished\":\"2019-03-26T17:44:03+00:00\",\"dateModified\":\"2019-03-26T17:44:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/\"},\"wordCount\":639,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image_thumb.png\",\"keywords\":[\"Containers\",\"PowerShell\",\"remoting\"],\"articleSection\":[\"Docker\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/\",\"name\":\"PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image_thumb.png\",\"datePublished\":\"2019-03-26T17:44:03+00:00\",\"dateModified\":\"2019-03-26T17:44:09+00:00\",\"description\":\"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image_thumb.png\",\"width\":931,\"height\":341},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6586\\\/powershell-remoting-sessions-and-containers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Docker\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/docker\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell Remoting Sessions and Containers\"}]},{\"@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":"PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator","description":"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.","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\/6586\/powershell-remoting-sessions-and-containers\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator","og_description":"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/","og_site_name":"The Lonely Administrator","article_published_time":"2019-03-26T17:44:03+00:00","article_modified_time":"2019-03-26T17:44:09+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell Remoting Sessions and Containers","datePublished":"2019-03-26T17:44:03+00:00","dateModified":"2019-03-26T17:44:09+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/"},"wordCount":639,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb.png","keywords":["Containers","PowerShell","remoting"],"articleSection":["Docker","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/","name":"PowerShell Remoting Sessions and Containers &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb.png","datePublished":"2019-03-26T17:44:03+00:00","dateModified":"2019-03-26T17:44:09+00:00","description":"Here are some hard-learned lessons about connecting a PowerShell remoting session to a Docker container in Windows.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb.png","width":931,"height":341},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Docker","item":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},{"@type":"ListItem","position":2,"name":"PowerShell Remoting Sessions and Containers"}]},{"@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":6629,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/","url_meta":{"origin":6586,"position":0},"title":"Extending PowerShell and Docker Containers","author":"Jeffery Hicks","date":"April 2, 2019","format":false,"excerpt":"I've been continuing to tinker with my PowerShell command for getting information about Docker containers. The Docker CLI is fine, but it is very difficult to work with the output or do much with it. That's why I prefer to have objects in a PowerShell pipeline. One of the Docker\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-6.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-6.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-6.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-6.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6612,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6612\/more-fun-with-docker-containers-and-powershell\/","url_meta":{"origin":6586,"position":1},"title":"More Fun with Docker Containers and PowerShell","author":"Jeffery Hicks","date":"March 29, 2019","format":false,"excerpt":"A few days ago I shared some experiences of working with Docker containers and PowerShell. As I continue to learn Docker, I am also learning how to manage it with PowerShell. The Docker command line tools are fine but I think they are even better when drizzled with a nice\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6751,"url":"https:\/\/jdhitsolutions.com\/blog\/training\/6751\/get-a-jump-start-on-docker\/","url_meta":{"origin":6586,"position":2},"title":"Get a Jump Start on Docker","author":"Jeffery Hicks","date":"June 5, 2019","format":false,"excerpt":"Over the last few years, perhaps no topic has caught fire as much as Docker and containers. If you're like me you've perhaps installed Docker for Windows, pulled down a Windows server image and tinkered a bit with it. Of course, there is so much more to learn and do\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/image.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5895,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5895\/another-look-at-powershell-core-version-information\/","url_meta":{"origin":6586,"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":8650,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8650\/removing-obsolete-powershell-remoting-configurations\/","url_meta":{"origin":6586,"position":4},"title":"Removing Obsolete PowerShell Remoting Configurations","author":"Jeffery Hicks","date":"October 20, 2021","format":false,"excerpt":"I'm pretty sure I've discussed this before, but Microsoft is scheduled to release PowerShell 7.2 soon, I thought it might be good to revisit this topic. Here's the potential issue. If you've been installing PowerShell 7 releases for a while, and have been enabling PowerShell remoting, you most likely have\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\/2021\/10\/saved-config.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/saved-config.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/saved-config.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":7969,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/7969\/deploy-openssh-server-to-windows-10\/","url_meta":{"origin":6586,"position":5},"title":"Deploy OpenSSH Server to Windows 10","author":"Jeffery Hicks","date":"December 16, 2020","format":false,"excerpt":"PowerShell 7 offers a number of compelling reasons to adopt it. One of the best is support for SSH as a PowerShell remoting protocol. Unfortunately, this is not a topic that typically comes up for Windows-centric IT Pros. I know this is definitely true in my case, and a deficiency\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\/12\/sshserver-installed.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6586","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=6586"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6586\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}