{"id":5595,"date":"2022-04-26T21:06:09","date_gmt":"2022-04-26T12:06:09","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=5595"},"modified":"2023-07-12T06:16:33","modified_gmt":"2023-07-11T21:16:33","slug":"powershell%e3%81%ae%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e9%96%8b%e7%99%ba%e3%82%92%e8%a1%8c%e3%81%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/5595","title":{"rendered":"PowerShell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u958b\u767a\u3059\u308b\uff01"},"content":{"rendered":"<p>PowerShell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u958b\u767a\u3092\u884c\u3046\u65b9\u6cd5\u3067\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>ps1\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u6700\u521d\u306b\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\u30d5\u30a9\u30eb\u30c0\u306b\u3001\u62e1\u5f35\u5b50\u304c\u300cps1\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u300ckeep_unlock.ps1\u300d\u3068\u3044\u3046\u3088\u3046\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h2>PowerShell ISE\u3092\u8d77\u52d5\u3059\u308b\uff01<\/h2>\n<p>PowerShell\u306eIDE\u74b0\u5883\u300cPowerShell ISE\u300d\u3092\u8d77\u52d5\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u304c\u697d\u3059\u308b\u30dd\u30a4\u30f3\u30c8\u3067\u3001ps1\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u7de8\u96c6\u3092\u9078\u3073\u307e\u3059\u3002\u3059\u308b\u3068\u3001ps1\u3092\u958b\u3044\u305f\u72b6\u614b\u3067\u3001PowerShell ISE\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<h2>PowerShell\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\uff01<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4f7f\u7528\u4e2d\u306e\u753b\u9762\u30ed\u30c3\u30af\u3092\u9632\u3050\u305f\u3081\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8f09\u3057\u3066PowerShell ISE\u4e0a\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$WSH = New-Object -Comobject wscript.shell\r\nwhile ($TRUE){\r\n  Get-Date\r\n  $WSH.sendkeys(&quot;+&quot;)\r\n  sleep 120\r\n}\r\n<\/pre>\n<p>\u300c\u3053\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u304c\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u30fb\u30fb\u30fb\u300d\u3067\u5b9f\u884c\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001PowerShell\u306e\u7ba1\u7406\u8005\u306e\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\Users\\sysadm00\\Documents\\ps1&gt; Get-ExecutionPolicy\r\nRestricted\r\nPS C:\\Users\\sysadm00\\Documents\\ps1&gt; Set-ExecutionPolicy -ExecutionPolicy RemoteSigned\r\nPS C:\\Users\\sysadm00\\Documents\\ps1&gt; Get-ExecutionPolicy\r\nRemoteSigned\r\n<\/pre>\n<h2>\u5b9f\u969b\u306bPowerShell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\uff01<\/h2>\n<p>PowerShell ISE\u3067\u306e\u30c6\u30b9\u30c8\u304c\u7d42\u4e86\u3057\u305f\u3089\u3001\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002PowerShell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u300cPowerShell\u3067\u5b9f\u884c\u300d\u3092\u9078\u3073\u307e\u3059\u3002<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>PowerShell\u306e\u958b\u767a\u74b0\u5883\u306f\u3001\u6539\u3081\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u305b\u305a\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12060\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PowerShell\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2019\/11\/fi_windows_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PowerShell\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">PowerShell\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002 PowerShell\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01 \u95a2\u9023\u8a18\u4e8b ...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/1867\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Windows\u306b\u5171\u901a\u3059\u308b\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2019\/11\/fi_windows_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Windows\u306b\u5171\u901a\u3059\u308b\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Windows\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u958b\u767a\u3092\u884c\u3046\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5292,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[227],"tags":[246,244,680,247],"class_list":["post-5595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershell","tag-windows","tag-680","tag-247"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/5595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=5595"}],"version-history":[{"count":3,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/5595\/revisions"}],"predecessor-version":[{"id":12068,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/5595\/revisions\/12068"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5292"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=5595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=5595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=5595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}