{"id":2074,"date":"2011-10-07T09:57:17","date_gmt":"2011-10-07T00:57:17","guid":{"rendered":"http:\/\/192.168.0.71:9090\/?p=2074"},"modified":"2011-10-07T09:57:17","modified_gmt":"2011-10-07T00:57:17","slug":"powershell-remoting-%ec%9b%90%ea%b2%a9-%ec%a0%91%ec%86%8d","status":"publish","type":"post","link":"https:\/\/talsu.net\/?p=2074","title":{"rendered":"Powershell &#8211; Remoting (\uc6d0\uaca9 \uc811\uc18d)"},"content":{"rendered":"<p>\uc6d0\uaca9\uc9c0\uc5d0 \uc788\ub294 Powershell \uc5d0 \uc811\uc18d\uc774 \uac00\ub2a5\ud558\ub2e4 \uc815\ud655\ud788\ub294 Session \uc744 \ub9cc\ub4e4\uc218 \uc788\ub294\ub370 \uc774 Session\uc744 \uc774\uc6a9\ud558\uc5ec \uc6d0\uaca9\uc9c0\uc5d0 \uc788\ub294 Powershell \uacfc \uc0c1\ud638\uc791\uc6a9\uc774 \uac00\ub2a5\ud55c\uac83\uc774\ub2e4.<br \/>\n\uc790\uc8fc\uc4f0\uac8c \ub418\ub294 \uae30\ub2a5\uc778\ub370 \ubb3c\uc5b4\ubcf4\ub294 \ubd84\ub4e4\uc774 \ub9ce\uc544 \uc815\ub9ac \ud574 \ub454\ub2e4.<br \/>\n\uc790\uc138\ud55c \uaddc\uce59\uc774\ub098 \ud504\ub85c\ud1a0\ucf5c, \uc6d0\ub9ac\ub4f1\uc744 \uc124\uba85\ud558\uba74 20\ud398\uc774\uc9c0\uc815\ub3c4 \ubb38\uc11c\uac00 \ub098\uc62c\uaebc \uac19\uc9c0\ub9cc \uc5ec\uae30\uc120 \ud544\uc694\ud55c \uacfc\uc815\ub4e4\uc5d0 \ub300\ud55c \uc124\uba85\ub9cc \uae30\ub85d\ud55c\ub2e4.<br \/>\n<br \/>\n\ubc14\uc05c\uc0ac\ub78c\ub4e4\uc740 \uc544\ub798\ub97c \ubcf4\uace0 \ub530\ub77c\ud558\uc790.<br \/>\n<br \/>\n<strong>A \uac00 B \uc5d0 \uc6d0\uaca9 \uc811\uc18d \ud558\uace0 \uc2f6\uc744 \ub54c.<\/strong><br \/>\n<\/p>\n<h4>\ucd08\uac04\ub2e8 \uc124\uc815<\/h4>\n<p>\uc815\ub9d0 \ubc14\uc058\uac70\ub098 \uc138\ubd80\ub0b4\uc6a9\uc744 \uc54c\uae30 \uc2eb\uace0 \ubaa8\ub974\uaca0\uc73c\uba74 A\uc640 B \uc591\ucabd\uc5d0 \uc544\ub798 \uba85\ub839\uc744 \uc785\ub825\ud558\uace0 &#8220;\uc0ac\uc6a9\ud558\uae30&#8221; \ub85c \ub118\uc5b4\uac00\uc790.<\/p>\n<pre class=\"lang:ps decode:true\">\nEnable-PSRemoting -Force\nSet-item WSMan:localhostClientTrustedHosts -Value * -Force\n<\/pre>\n<p><\/p>\n<h3>A \uce21\uc5d0 \ud560 \uc791\uc5c5<\/h3>\n<h4>Enable-PSRemoting<\/h4>\n<pre class=\"lang:ps nums:false decode:true\">\nEnable-PSRemoting\n<\/pre>\n<p>\ub2e4\uc74c\uacfc \uac19\uc740 \uc14b\ud305\uc744 \ud55c\uaebc\ubc88\uc5d0 \ud558\ub824\uace0 \ud55c\ub2e8\ub2e4.<\/p>\n<pre class=\"lang:default nums:false decode:true\">\n1. WinRM \uc11c\ube44\uc2a4 \uc2dc\uc791 \ub610\ub294 \ub2e4\uc2dc \uc2dc\uc791(\uc774\ubbf8 \uc2dc\uc791\ub41c \uacbd\uc6b0)\n2. WinRM \uc11c\ube44\uc2a4 \uc720\ud615\uc744 \uc790\ub3d9 \uc2dc\uc791\uc73c\ub85c \uc124\uc815\n3. \ubaa8\ub4e0 IP \uc8fc\uc18c\uc5d0 \ub300\ud55c \uc694\uccad\uc744 \ud5c8\uc6a9\ud558\ub294 \uc218\uc2e0\uae30 \ub9cc\ub4e4\uae30\n4. WS-Management \ud2b8\ub798\ud53d\uc5d0 \ub300\ud55c \ubc29\ud654\ubcbd \uc608\uc678 \uc0ac\uc6a9(http \uc804\uc6a9)\n<\/pre>\n<p>\uadf8\ub4a4 SDDL \ubcc4\ub85c <strong>Set-PSSessionConfiguration<\/strong> \uc744 \uc218\ud589 \ud558\uba74\uc11c \uc9c8\ubb38\uc744 \ud558\ub294\ub370, \ud544\uc694\ud55c\uac83 \uac83\ub4e4\uc5d0 \ub300\ud574 Y\ub97c \ub20c\ub824 \uc218\ud589\ud55c\ub2e4. (\uc798 \ubaa8\ub974\uaca0\uc73c\uba74 A &#8211; Yes to All)<br \/>\n<br \/>\n<a href=\"wp-content\/uploads\/2011\/10\/Enable-PSRemoting.png\"><img loading=\"lazy\" src=\"wp-content\/uploads\/2011\/10\/Enable-PSRemoting-150x150.png\" alt=\"\" title=\"Enable-PSRemoting\" width=\"150\" height=\"150\" class=\"alignnone size-thumbnail wp-image-2086\" \/><\/a><br \/>\n<br \/>\n<strong>\uc774\ud574\uac00 \uc798 \uc548\uac00\uac70\ub098 \ub2e4 Yes \ud558\uace0 \uc2f6\uc73c\uba74 -Force \uc635\uc158\uc744 \ubd99\ud788\uc790.<\/strong><\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nEnable-PSRemoting -Force\n<\/pre>\n<p><\/p>\n<h3>A \uc640 B \uc5d0 \ubaa8\ub450 \ud560 \uc791\uc5c5<\/h3>\n<h4>WSMan:localhostClientTrustedHosts \uc124\uc815<\/h4>\n<p>Powershell \uc6d0\uaca9\uc81c\uc5b4\ub97c \ud558\ub294 Protocol \uc740 \uc0c1\ud638\uac04\uc5d0 TrustedHost \uac00 \uc124\uc815 \ub418\uc5b4 \uc788\uc5b4\uc57c \ud55c\ub2e4.<br \/>\n\ub2e4\uc74c \uba85\ub839\uc73c\ub85c \ud604\uc7ac \uac12\uc744 \ud655\uc774\ud574 \ubcf4\uba74 Value \uac00 \uacf5\ub780\uc73c\ub85c \uc788\uc744 \uac83\uc774\ub2e4.<\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nGet-Item WSMan:localhostClientTrustedHosts\n<\/pre>\n<p>\uc774 \uac12\uc744 \uc0c1\ub300\ubc29\uc758 ComputerName, IP, Domain \ub4f1\uc73c\ub85c \uc124\uc815\ud558\uba74\ub41c\ub2e4.<br \/>\n\uac12\uc740 ,\ub85c \uad6c\ubd84\ud574 Array\ub85c \ub123\uc744 \uc218 \uc788\uace0 * \ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p>\n\uc608\ub97c \ub4e4\uc5b4.<br \/>\n<br \/>\n\ubaa8\ub4e0 \ub300\uc0c1\uc5d0 \ub300\ud574\uc11c \ud5c8\uc6a9.<\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nSet-item WSMan:localhostClientTrustedHosts -value *\n<\/pre>\n<p>\ucef4\ud4e8\ud130 \uc774\ub984\uc774 Alpha, Beta \uc778 \ub450 \ub300\uc0c1\uc744 \ud5c8\uc6a9.<\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nSet-item WSMan:localhostClientTrustedHosts -value Alpha,Beta\n<\/pre>\n<p>IP \uac00 192.168.0.10 \uc778 \ub300\uc0c1\uc744 \ud5c8\uc6a9.<\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nSet-item WSMan:localhostClientTrustedHosts -value 192.168.0.10\n<\/pre>\n<p>\n<strong>\uc5ed\uc2dc \uc798 \ubaa8\ub974\uaca0\uc73c\uba74 \ub2e4\uc74c\uc744 \uc785\ub825\ud558\uc790.<\/strong><\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nSet-item WSMan:localhostClientTrustedHosts -value *\n<\/pre>\n<p><\/p>\n<h3>\uc0ac\uc6a9 \ud558\uae30<\/h3>\n<p>ssh \ub098 telnet \ucc98\ub7fc \uc6d0\uaca9\uc73c\ub85c \uc811\uc18d\ud558\uc5ec \uc0ac\uc6a9\ud558\uae38 \uc6d0\ud558\uba74 \ub2e4\uc74c \uba85\ub839\uc744 \uc774\uc6a9\ud55c\ub2e4.<\/p>\n<pre class=\"lang:ps nums:false decode:true\">\nEnter-PSSession [\ub300\uc0c1]\n<\/pre>\n<p><a href=\"wp-content\/uploads\/2011\/10\/Enter-PSSession.png\"><img loading=\"lazy\" src=\"wp-content\/uploads\/2011\/10\/Enter-PSSession-150x150.png\" alt=\"\" title=\"Enter-PSSession\" width=\"150\" height=\"150\" class=\"alignnone size-thumbnail wp-image-2096\" \/><\/a><br \/>\n<\/p>\n<p>\uba85\ub839\ud558\ub098\ub97c \uc6d0\uaca9\uc9c0\uc5d0 \uc218\ud589\ud558\uace0 \uc2f6\ub2e4\uba74 Invoke-Command \ub97c \uc774\uc6a9\ud55c\ub2e4.<\/p>\n<pre class=\"lang:ps decode:true\">\nInvoke-Command -ComputerName [\ub300\uc0c1] -ScriptBlock {[\uc218\ud589\ud560 \uba85\ub839, \uc2a4\ud06c\ub9bd\ud2b8]}\n<\/pre>\n<p>\uc608<\/p>\n<pre class=\"lang:ps decode:true\">\nInvoke-Command -ComputerName talsu.net -ScriptBlock {Get-Process}\n<\/pre>\n<p>ComputerName \ub300\uc2e0 \ubbf8\ub9ac New-PSSession \uba85\ub839\uc744 \uc774\uc6a9\ud574 Session \uc744 \ub9cc\ub4e4\uc5b4 \uadf8\uac83\uc744 \uc0ac\uc6a9\ud560 \uc218\ub3c4 \uc788\ub2e4. \ub9d0\uadf8\ub300\ub85c \uac19\uc740Session\uc5d0\uc11c \uc218\ud589 \ub418\uae30 \ub54c\ubb38\uc5d0 \uc5f0\uc18d\uc801\uc778 \uc791\uc5c5\uc744 \ub098\ub204\uc5b4 \ud560\uc218 \uc788\uace0 \uc5ec\ub7ec\ubc88 \uc218\ud589\ud560\ub54c \uc18d\ub3c4\ub3c4 \ube60\ub974\ub2e4.<\/p>\n<pre class=\"lang:ps decode:true\">\n$session = New-PSSession [\ub300\uc0c1]\nInvoke-Command -Session $session -ScriptBlock {[\uc218\ud589\ud560 \uba85\ub839, \uc2a4\ud06c\ub9bd\ud2b8]}\n<\/pre>\n<p>\uc608<\/p>\n<pre class=\"lang:ps decode:true\">\n$session = New-PSSession talsu.net\nInvoke-Command -Session $session -ScriptBlock {Get-Process}\n<\/pre>\n<p>\n<a href=\"wp-content\/uploads\/2011\/10\/Invoke-Command.png\"><img loading=\"lazy\" src=\"wp-content\/uploads\/2011\/10\/Invoke-Command-150x150.png\" alt=\"\" title=\"Invoke-Command\" width=\"150\" height=\"150\" class=\"alignnone size-thumbnail wp-image-2098\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc6d0\uaca9\uc9c0\uc5d0 \uc788\ub294 Powershell \uc5d0 \uc811\uc18d\uc774 \uac00\ub2a5\ud558\ub2e4 \uc815\ud655\ud788\ub294 Session \uc744 \ub9cc\ub4e4\uc218 \uc788\ub294\ub370 \uc774 Session\uc744 \uc774\uc6a9\ud558\uc5ec \uc6d0\uaca9\uc9c0\uc5d0 \uc788\ub294 Powershell \uacfc \uc0c1\ud638\uc791\uc6a9\uc774 \uac00\ub2a5\ud55c\uac83\uc774\ub2e4. \uc790\uc8fc\uc4f0\uac8c \ub418\ub294 \uae30\ub2a5\uc778\ub370 \ubb3c\uc5b4\ubcf4\ub294 \ubd84\ub4e4\uc774 \ub9ce\uc544 \uc815\ub9ac \ud574 \ub454\ub2e4. \uc790\uc138\ud55c \uaddc\uce59\uc774\ub098 \ud504\ub85c\ud1a0\ucf5c, \uc6d0\ub9ac\ub4f1\uc744 \uc124\uba85\ud558\uba74 20\ud398\uc774\uc9c0\uc815\ub3c4 \ubb38\uc11c\uac00 \ub098\uc62c\uaebc \uac19\uc9c0\ub9cc \uc5ec\uae30\uc120 \ud544\uc694\ud55c \uacfc\uc815\ub4e4\uc5d0 \ub300\ud55c \uc124\uba85\ub9cc \uae30\ub85d\ud55c\ub2e4. \ubc14\uc05c\uc0ac\ub78c\ub4e4\uc740 \uc544\ub798\ub97c \ubcf4\uace0 \ub530\ub77c\ud558\uc790. A \uac00 B \uc5d0 \uc6d0\uaca9 \uc811\uc18d \ud558\uace0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[25,26,6],"tags":[107,111,146,180,481,196,199,214,401],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pXV5a-xs","_links":{"self":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/2074"}],"collection":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2074"}],"version-history":[{"count":0,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/2074\/revisions"}],"wp:attachment":[{"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}