{"id":2823,"date":"2016-03-10T12:59:05","date_gmt":"2016-03-10T12:59:05","guid":{"rendered":"http:\/\/tomaskalabis.com\/wordpress\/?p=2823"},"modified":"2016-03-10T13:01:23","modified_gmt":"2016-03-10T13:01:23","slug":"manage-windows-virtual-machines-with-powershell-direct","status":"publish","type":"post","link":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/","title":{"rendered":"Manage Windows virtual machines with PowerShell Direct"},"content":{"rendered":"<p><strong>PowerShell Direct<\/strong> &#8211; pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016.<\/p>\n<ul>\n<li>P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM &#8211; bez network connectivity (v\u0161e leze p\u0159es vmbus)<\/li>\n<li>A aby to nebylo m\u00e1lo, m\u016f\u017eu p\u0159es vmbus kop\u00edrovat (copy-vmfile) &#8211; a zase bez network connectivity<\/li>\n<li>Nic nenastavuji, jedin\u00fd co pot\u0159ebuji je heslo k VM<\/li>\n<li>Pomoc\u00ed Invoke-Commnand mohu vykon\u00e1vat skripty ve vzd\u00e1len\u00e9m VM<\/li>\n<\/ul>\n<p>V minul\u00e9m \u010dl\u00e1nku jsem vytv\u00e1\u0159el <a href=\"http:\/\/tomaskalabis.com\/wordpress\/vytvoreni-nano-server-v-hyper-v-2016\/\" target=\"_blank\">NANO Server na Hyper-V 2016<\/a> a te\u010f se pomoc\u00ed PowerShell Direct k n\u011bmu p\u0159ipoj\u00edme a nastav\u00edme<\/p>\n<ul>\n<li>statickou IP adresu<\/li>\n<li>DNS servery<\/li>\n<li>offline join do dom\u00e9ny<\/li>\n<\/ul>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">Enter-PSSession -VMName NANO01 -Credential administrator<\/pre>\n<p>Nejprve se z Hyper-V hosta p\u0159ipoj\u00edme k VM pr\u00e1v\u011b pomoc\u00ed Enter-PSSession<\/p>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">New-NetIPAddress -InterfaceAlias \u201aEthernet\u2018 -IPAddress 192.168.168.120 -PrefixLength 24<\/pre>\n<p>Nastav\u00edme mu statickou IP adresu 192.168.168.120\/24<\/p>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">Set-DnsClientServerAddress -InterfaceAlias \u201aEthernet\u2018 -ServerAddresses 192.168.168.10<\/pre>\n<p>A nyn\u00ed je t\u0159eba nastavit preferovan\u00fd DNS server 192.168.168.10<\/p>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">djoin.exe \/provision \/domain demolab.local \/machine NanoHOST1 \/savefile c:\\temp\\nanohost1<\/pre>\n<p>Nyn\u00ed provedeme offline domain join, k tomu budeme pot\u0159ebovat dom\u00e9nov\u00fd \u0159adi\u010d, ke kter\u00e9mu se p\u0159ipoj\u00edme a v cmd pod administr\u00e1torem pust\u00edme p\u0159\u00edkaz djoin.exe<\/p>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">Copy-VMFile \"NANO01\" -SourcePath \"C:\\temp\\nanohost1\" -DestinationPath \"C:\\temp\\nanohost1\" -CreateFullPath -FileSource Host<\/pre>\n<p>Nakop\u00edrujeme soubor nanohost1, kter\u00fd vznikl p\u0159edchoz\u00edm p\u0159\u00edkazem na n\u00e1\u0161 Nano host a to t\u0159eba pomoc\u00ed Copy-VMFile (proto abychom mohli pou\u017e\u00edt Copy-VMFile, je pot\u0159eba v nastaven\u00ed VM j\u00edt do Integration Services a povolit &#8222;<strong>Guest Services<\/strong>&#8222;) jo a kop\u00edrov\u00e1n\u00ed jede p\u0159es vmbus \ud83d\ude42<\/p>\n<pre class=\"theme:powershell font:consolas lang:default decode:true\">djoin.exe \/requestodj \/loadfile c:\\Temp\\nanohost1 \/windowspath c:\\windows \/localos\r\nshutdown \/r \/t 0 \/f<\/pre>\n<p>Vr\u00e1t\u00edme se do PowerShell okna, kde m\u00e1m rozjet\u00e9 p\u0159ipojen\u00ed k VM NANO01 a p\u0159id\u00e1me jej do dom\u00e9ny a n\u00e1sledn\u011b provedu reboot VM.<\/p>\n<p>A m\u00e1m hotovo, pokud bych cht\u011bl s Nano serverem n\u011bjak d\u00e1l experminentovat, t\u0159eba na n\u011bm rozjet Nested Hyper-V m\u016f\u017eete se inspirovat v \u010dl\u00e1nku o <a href=\"http:\/\/tomaskalabis.com\/wordpress\/hyper-v-2016-nested-virtualizace\/\" target=\"_blank\">Nested Virtualization na Hyper-V 2016. <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell Direct &#8211; pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM &#8211; bez network connectivity (v\u0161e &#8230;<\/p>\n","protected":false},"author":2,"featured_media":2674,"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,"footnotes":""},"categories":[98,229],"tags":[217,163,230],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Manage Windows virtual machines with PowerShell Direct<\/title>\n<meta name=\"description\" content=\"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/\" \/>\n<meta property=\"og:locale\" content=\"cs_CZ\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Manage Windows virtual machines with PowerShell Direct\" \/>\n<meta property=\"og:description\" content=\"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/\" \/>\n<meta property=\"og:site_name\" content=\"tomaskalabis.com\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-10T12:59:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-10T13:01:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png\" \/>\n\t<meta property=\"og:image:width\" content=\"215\" \/>\n\t<meta property=\"og:image:height\" content=\"174\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tomas Kalabis\" \/>\n<meta name=\"twitter:label1\" content=\"Napsal(a)\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomas Kalabis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Odhadovan\u00e1 doba \u010dten\u00ed\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/\",\"name\":\"Manage Windows virtual machines with PowerShell Direct\",\"isPartOf\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png\",\"datePublished\":\"2016-03-10T12:59:05+00:00\",\"dateModified\":\"2016-03-10T13:01:23+00:00\",\"author\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6\"},\"description\":\"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM\",\"breadcrumb\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#breadcrumb\"},\"inLanguage\":\"cs\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png\",\"contentUrl\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png\",\"width\":215,\"height\":174},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tomaskalabis.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manage Windows virtual machines with PowerShell Direct\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#website\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/\",\"name\":\"tomaskalabis.com\",\"description\":\"my personal blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tomaskalabis.com\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"cs\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6\",\"name\":\"Tomas Kalabis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g\",\"caption\":\"Tomas Kalabis\"},\"sameAs\":[\"https:\/\/x.com\/tomaskalabis\"],\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/author\/kalabis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Manage Windows virtual machines with PowerShell Direct","description":"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM","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:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/","og_locale":"cs_CZ","og_type":"article","og_title":"Manage Windows virtual machines with PowerShell Direct","og_description":"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM","og_url":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/","og_site_name":"tomaskalabis.com","article_published_time":"2016-03-10T12:59:05+00:00","article_modified_time":"2016-03-10T13:01:23+00:00","og_image":[{"width":215,"height":174,"url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png","type":"image\/png"}],"author":"Tomas Kalabis","twitter_misc":{"Napsal(a)":"Tomas Kalabis","Odhadovan\u00e1 doba \u010dten\u00ed":"2 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/","url":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/","name":"Manage Windows virtual machines with PowerShell Direct","isPartOf":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage"},"image":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage"},"thumbnailUrl":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png","datePublished":"2016-03-10T12:59:05+00:00","dateModified":"2016-03-10T13:01:23+00:00","author":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6"},"description":"PowerShell Direct - pro m\u011b asi jedna z nejlep\u0161\u00edch v\u011bc\u00ed, kter\u00e1 se objevila ve Windows Server 2016. P\u0159ipojuji se p\u0159\u00edmo pomoc\u00ed vmbus do hyper-v VM","breadcrumb":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#breadcrumb"},"inLanguage":"cs","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/"]}]},{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#primaryimage","url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png","contentUrl":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png","width":215,"height":174},{"@type":"BreadcrumbList","@id":"https:\/\/tomaskalabis.com\/wordpress\/manage-windows-virtual-machines-with-powershell-direct\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tomaskalabis.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Manage Windows virtual machines with PowerShell Direct"}]},{"@type":"WebSite","@id":"https:\/\/tomaskalabis.com\/wordpress\/#website","url":"https:\/\/tomaskalabis.com\/wordpress\/","name":"tomaskalabis.com","description":"my personal blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tomaskalabis.com\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"cs"},{"@type":"Person","@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6","name":"Tomas Kalabis","image":{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g","caption":"Tomas Kalabis"},"sameAs":["https:\/\/x.com\/tomaskalabis"],"url":"https:\/\/tomaskalabis.com\/wordpress\/author\/kalabis\/"}]}},"jetpack_featured_media_url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/01\/winsrv2016.png","_links":{"self":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/2823"}],"collection":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2823"}],"version-history":[{"count":1,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/2823\/revisions"}],"predecessor-version":[{"id":2825,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/2823\/revisions\/2825"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/media\/2674"}],"wp:attachment":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}