{"id":2448,"date":"2017-04-15T21:12:44","date_gmt":"2017-04-15T12:12:44","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=2448"},"modified":"2020-04-18T20:45:39","modified_gmt":"2020-04-18T11:45:39","slug":"post-2448","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=2448","title":{"rendered":"PowerShell \u3092\u5229\u7528\u3057\u3066 Office 365 \u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b"},"content":{"rendered":"<p>\u4ee5\u524d <a href=\"http:\/\/1bed.allright.life\/?p=2004\">Ruby \u3092\u4f7f\u3063\u3066 Gmail \u7d4c\u7531\u3067\u30e1\u30fc\u30eb\u9001\u4fe1<\/a> \u3068\u3044\u3046\u30d6\u30ed\u30b0\u3092\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306f Windows \u3067\u5b9a\u671f\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406(PowerShell)\u304b\u3089\u30ec\u30dd\u30fc\u30c8\u30e1\u30fc\u30eb\u3092\u9001\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<h2>\u74b0\u5883<\/h2>\n<ul>\n<li>Windows 10 Pro<\/li>\n<li>PowerShell 5.1<\/li>\n<\/ul>\n<h2>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n<p>\u81ea\u5206\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9(\u5dee\u51fa\u4eba)\u304c miyamiya@example.com \u3001\u5b9b\u5148\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c misono@example.jp \u3068\u3057\u3066\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u308b\u3002\u3053\u3053\u3067\u306f miyamiya@example.com \u304c Office 365 \u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3068\u3059\u308b\u3002<\/p>\n<pre><code class=\"language-powershell\"># Office 365 \u306e\u8a8d\u8a3c\u60c5\u5831\n$o365User = &#039;miyamiya@example.com&#039;;\n$o365Pass = &#039;Office365 \u306e\u30d1\u30b9\u30ef\u30fc\u30c9&#039;;\n# \u5dee\u51fa\u4eba\n$from    = &#039;miyamiya@example.com&#039;;\n# \u5b9b\u5148\n$to      = &#039;misono@example.jp&#039;;\n# \u30e1\u30fc\u30eb\u306e\u30bf\u30a4\u30c8\u30eb\u3068\u672c\u6587\n$subject = &#039;\u30e1\u30fc\u30eb\u306e\u30bf\u30a4\u30c8\u30eb&#039;;\n$body    = &#039;\u30e1\u30fc\u30eb\u306e\u672c\u6587&#039;;\n\n# MailMessage \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\n$msg = New-Object System.Net.Mail.MailMessage($from, $to, $subject, $body);\n\n# Office 365 \u306e SMTP \u30b5\u30fc\u30d0\u30fc\u3092\u8a2d\u5b9a\u3057\u3066 SmtpClient \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\n$SMTPClient = New-Object Net.Mail.SmtpClient(&quot;smtp.office365.com&quot;, 587) ;\n\n# SSL \u3092 True \u306b\u8a2d\u5b9a\n$SMTPClient.EnableSsl = $true;\n\n# Office 365 \u3078\u306e\u8a8d\u8a3c\n$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($o365User, $o365Pass);\n\n# \u30e1\u30fc\u30eb\u9001\u4fe1\n$SMTPClient.send($msg);<\/code><\/pre>\n<h2>\u53c2\u8003<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/blogs.technet.microsoft.com\/junichia\/2011\/12\/08\/powershellwindows-powershell-gmail-office-365\/\">\u3010PowerShell\u3011Windows PowerShell \u3092\u4f7f\u7528\u3057\u3066 GMail \u3084 Office 365 \u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/support.office.com\/ja-jp\/article\/%25E4%25B8%2580%25E8%2588%25AC%25E6%25B3%2595%25E4%25BA%25BA%25E5%2590%2591%25E3%2581%2591-Office-365-%25E7%2594%25A8%25E3%2581%25AE-Outlook-POP-%25E3%2581%258A%25E3%2582%2588%25E3%2581%25B3-Outlook-IMAP-%25E3%2581%25AE%25E8%25A8%25AD%25E5%25AE%259A-7fc677eb-2491-4cbc-8153-8e7113525f6c?ui=ja-JP&amp;rs=ja-JP&amp;ad=JP\">\u4e00\u822c\u6cd5\u4eba\u5411\u3051 Office 365 \u7528\u306e Outlook POP \u304a\u3088\u3073 Outlook IMAP \u306e\u8a2d\u5b9a<\/a><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d Ruby \u3092\u4f7f\u3063\u3066 Gmail \u7d4c\u7531\u3067\u30e1\u30fc\u30eb\u9001\u4fe1 \u3068\u3044\u3046\u30d6\u30ed\u30b0\u3092\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306f Windows \u3067\u5b9a\u671f\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406(PowerShell)\u304b\u3089\u30ec\u30dd\u30fc\u30c8\u30e1\u30fc\u30eb\u3092\u9001\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002 \u74b0\u5883 Windows [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[62],"class_list":["post-2448","post","type-post","status-publish","format-standard","hentry","category-program","tag-powershell"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2448"}],"version-history":[{"count":2,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2448\/revisions"}],"predecessor-version":[{"id":3131,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2448\/revisions\/3131"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}