{"id":3444,"date":"2015-11-29T12:27:34","date_gmt":"2015-11-29T03:27:34","guid":{"rendered":"http:\/\/www.syuheiuda.com\/?p=3444"},"modified":"2015-12-13T10:25:51","modified_gmt":"2015-12-13T01:25:51","slug":"powershell-dsc-%e3%81%a7%e9%81%8a%e3%82%93%e3%81%a7%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.syuheiuda.com\/?p=3444","title":{"rendered":"PowerShell DSC \u3067\u904a\u3093\u3067\u307f\u308b"},"content":{"rendered":"<p>\u81ea\u5b85\u306e\u691c\u8a3c\u74b0\u5883\u3092\u4e00\u6589\u518d\u69cb\u7bc9\u3059\u308b\u611f\u3058\u306b\u306a\u3063\u305f\u306e\u3067\u3001RDP \u306e\u6709\u52b9\u5316\u3092 PS DSC \u3067\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u624b\u59cb\u3081\u306b PowerShell DSC \u30e2\u30b8\u30e5\u30fc\u30eb\u7fa4\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001<br \/>C:\\ProgramFiles\\WindowsPowerShell\\Modules \u914d\u4e0b\u306b\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\n<p><a title=\"https:\/\/gallery.technet.microsoft.com\/scriptcenter\/DSC-Resource-Kit-All-c449312d\" href=\"https:\/\/gallery.technet.microsoft.com\/scriptcenter\/DSC-Resource-Kit-All-c449312d\">https:\/\/gallery.technet.microsoft.com\/scriptcenter\/DSC-Resource-Kit-All-c449312d<\/a><\/p>\n<p>\u3044\u3061\u3044\u3061\u5404\u7aef\u672b\u306b\u30b3\u30d4\u30fc\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3066\u3001WinRM \u3092\u6709\u52b9\u5316\u3057\u305f\u4e0a\u3067\u30d7\u30c3\u30b7\u30e5\u3059\u308c\u3070 OK\u3002<br \/>\u3068\u306f\u3044\u3048\u3001\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u5c55\u958b\u3059\u308b\u5834\u5408\u306f\u4f5c\u308a\u3053\u307f\u304c\u3044\u308b\u306e\u3067\u3001\u307e\u305a\u306f\u30ed\u30fc\u30ab\u30eb\u3067\u3002<\/p>\n<h2><\/h2>\n<h2>1. \u30ed\u30fc\u30ab\u30eb\u5b9f\u884c\u306e\u5834\u5408<\/h2>\n<p>\u3068\u308a\u3042\u3048\u305a\u4e8b\u524d\u8a2d\u5b9a\u3068\u3057\u3066\u306f\u7ba1\u7406\u8005\u6a29\u9650\u3067 PowerShell \u3092\u958b\u3044\u3066\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: ps;\"><p>Enable-PSRemoting -Force\nSet-Item wsman:\\localhost\\Client\\TrustedHosts -Value * -Force\nSet-ExecutionPolicy Unrestricted \nGet-ChildItem \u201cC:\\Program Files\\WindowsPowerShell\\Modules\\\u201d \u2013recurse | Unblock-File<\/p><\/pre>\n<p>\u4e0a\u306e 2 \u884c\u306f WinRM \u306e\u6709\u52b9\u5316\u30013 \u884c\u76ee\u304c PowerShell \u306e\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u5909\u66f4\u3001<br \/>\u6700\u5f8c\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u62ec\u30a2\u30f3\u30d6\u30ed\u30c3\u30af\u3067\u3059\u3002<\/p>\n<p>\u3042\u3068\u306f ExampleConfiguration-RemoteDesktopAdmin.ps1 \u3068\u304b\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001<br \/>\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u306e RDP \u304c\u6709\u52b9\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>2. \u30ea\u30e2\u30fc\u30c8\u5b9f\u884c\u306e\u5834\u5408<\/h2>\n<p>\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001WinRM \u3082 PS \u3082\u4e8b\u524d\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\u3044\u3061\u3044\u3061\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3089\u308c\u306a\u3044\u306e\u3067\u3001GPO \u3067\u6492\u3044\u3066\u3057\u307e\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<blockquote>\n<p>[\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u306e\u69cb\u6210] &#8211; [\u7ba1\u7406\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8] &#8211; [Windows \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8] &#8211; [Windows \u30ea\u30e2\u30fc\u30c8\u7ba1\u7406 (WinRM)] \u2013 [WinRM \u30af\u30e9\u30a4\u30a2\u30f3\u30c8] \u2013 [\u4fe1\u983c\u3055\u308c\u305f\u30db\u30b9\u30c8] \u3092\u6709\u52b9\u5316\u3057\u3066\u3001TrustedHostsList \u306b * \u6307\u5b9a\u3002<\/p>\n<p>[\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u306e\u69cb\u6210] &#8211; [\u7ba1\u7406\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8] &#8211; [Windows \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8] &#8211; [Windows \u30ea\u30e2\u30fc\u30c8\u7ba1\u7406 (WinRM)] \u2013 [WinRM \u30b5\u30fc\u30d3\u30b9] \u2013 [WinRM \u306b\u3088\u308b\u30ea\u30e2\u30fc\u30c8 \u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u3092\u8a31\u53ef\u3059\u308b] \u3092\u6709\u52b9\u5316\u3002\u30d5\u30a3\u30eb\u30bf\u30fc\u306f\u3044\u305a\u308c\u3082 * \u3092\u6307\u5b9a\u3002<\/p>\n<p>[\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u306e\u69cb\u6210] &#8211; [\u7ba1\u7406\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8] &#8211; [Windows \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8] &#8211; [Windows PowerShell] \u2013 [\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u3092\u6709\u52b9\u306b\u3059\u308b] \u3067 \u201c\u3059\u3079\u3066\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a31\u53ef\u3059\u308b\u306b\u8a2d\u5b9a\u3002\u201d<\/p>\n<\/blockquote>\n<p>\u6642\u9593\u306a\u3044\u306e\u3067\u3068\u308a\u3042\u3048\u305a\u3053\u3053\u307e\u3067\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u5b85\u306e\u691c\u8a3c\u74b0\u5883\u3092\u4e00\u6589\u518d\u69cb\u7bc9\u3059\u308b\u611f\u3058\u306b\u306a\u3063\u305f\u306e\u3067\u3001RDP \u306e\u6709\u52b9\u5316\u3092 PS DSC&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.syuheiuda.com\/?p=3444\">Read more &rarr;<\/a><\/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,"_locale":"","_original_post":""},"categories":[37,30,7,9,13],"tags":[],"views":5698,"_links":{"self":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3444"}],"collection":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3444"}],"version-history":[{"count":4,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3444\/revisions"}],"predecessor-version":[{"id":3454,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3444\/revisions\/3454"}],"wp:attachment":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}