<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>Eric&#039;s Blog - office管理</title>
<link>https://eblog.ink/category/office%E7%AE%A1%E7%90%86/</link>
<atom:link href="https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Mon, 29 Jun 2020 08:27:00 +0000</lastBuildDate>
<pubDate>Mon, 29 Jun 2020 08:27:00 +0000</pubDate>
<item>
<title>OneDrive扩容25T最新格式</title>
<link>https://eblog.ink/archives/231/</link>
<guid>https://eblog.ink/archives/231/</guid>
<pubDate>Mon, 29 Jun 2020 08:27:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[1、下载、安装，并管理员运行 SharePoint Online Management Shell工具2、输入命令：connect-sposervice3、输入命令：https://XXX-ad...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>1、下载、安装，并管理员运行 SharePoint Online Management Shell工具</p><p>2、输入命令：connect-sposervice</p><p>3、输入命令：<a href="https://XXX-admin.sharepoint.com">https://XXX-admin.sharepoint.com</a> xxx为单位名称 XXX.onmicrosoft.com 里的XXX</p><p>4、登录全局管理员</p><p>5、输入命令：Set-SPOSite -Identity 用户OneDrive的链接 -StorageQuota 26214400</p><p>原文链接：<a href="https://www.7lez.com/?p=257">链接</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/231/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>利用Github Action刷Microsoft 365 E5开发者订阅API实现续订</title>
<link>https://eblog.ink/archives/228/</link>
<guid>https://eblog.ink/archives/228/</guid>
<pubDate>Mon, 29 Jun 2020 05:49:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[准备工作&lt;!--more--&gt;1）E5管理账号2）Github账号（不建议用常用账号）3）记事本（用于记录ID密码！）开源项目&lt;!--more--&gt;https://git...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>准备工作</p><p>&lt;!--more--&gt;</p><p>1）E5管理账号</p><p>2）Github账号（不建议用常用账号）</p><p>3）记事本（用于记录ID密码！）</p><p>开源项目</p><p>&lt;!--more--&gt;</p><p><a href="https://github.com/wangziyingwen/AutoApiSecret">https://github.com/wangziyingwen/AutoApiSecret</a></p><p>项目说明中有完整的教程！博主按照教程撸了一遍！然后补全图片和完善文案！</p><p>操作步骤</p><p>&lt;!--more--&gt;</p><p>申请试用<br>移步文章：<a href="https://eblog.ink/archives/227/">免费申请Microsoft 365 E5开发者试用订阅教程</a> </p><p>获取Token<br>这里介绍完全自己！</p><p>1）前往 <a href="https://portal.azure.com/">https://portal.azure.com/</a> 登陆E5管理账号注册应用。</p><p>首页找到【Azure Active Directory】（如果没有可以搜索）然后点击【应用注册】-&gt; 【+新注册】！<br><img src="https://pic.rmb.bdstatic.com/bjh/02d71730c6d3127bad103dd7c88c83da.png" alt="1" title="1"><br><img src="https://pic.rmb.bdstatic.com/bjh/01e0c00051e1c9f1d7d21ea512c0c7ea.png" alt="2" title="2"><br>2）【名称】 随便填写，受支持的账户类型 选择【任何组织目录(任何 Azure AD 目录 – 多租户)中的帐户】</p><p>【重定向URI】填写：<a href="http://localhost:53682/">http://localhost:53682/</a></p><p>然后点击【注册】<br><img src="https://pic.rmb.bdstatic.com/bjh/a97d9c17cc21038cf4fd6410210a21aa.png" alt="3" title="3"><br>3）注册成功后，将【应用程序(客户端)ID】记录下来，后面会用到！<br><img src="https://pic.rmb.bdstatic.com/bjh/05c91736bd458252d4fad1d67b3f2ff3.png" alt="4" title="4"><br>4）点击左侧菜单【API权限】-&gt; 【添加权限】 -&gt; 【Microsoft Graph】-&gt; 选中【委托的权限】</p><p>以下权限分别搜索勾选！勾选完点击按钮【添加权限】</p><p>Files.Read.All      Files.ReadWrite.All</p><p>Sites.Read.All      Sites.ReadWrite.All</p><p>User.Read.All      User.ReadWrite.All</p><p>Directory.Read.All      Directory.ReadWrite.All</p><p>Mail.Read      Mail.ReadWrite</p><p>MailboxSettings.Read      MailboxSettings.ReadWrite</p><p><img src="https://pic.rmb.bdstatic.com/bjh/1b1cb013b6b7477a1b4c409a24c45379.png" alt="5" title="5"></p><p>5）在API权限页面，如果界面上有【代表xxx授予管理员同意】按钮，一定要点一下，然后同意授权！</p><p>如果没有这个按钮，就不用管了！<br><img src="https://pic.rmb.bdstatic.com/bjh/846189e6a636dc4f300a814696621d05.png" alt="6" title="6"><br><img src="https://pic.rmb.bdstatic.com/bjh/e3469d880e4f0c5fb60426bc7cda1f83.png" alt="7" title="7"></p><p>6）点击左侧菜单【证书和密码】-&gt; 【+新客户端密码】</p><p>【说明】随便填，【截止期限】随便选！点击【添加】按钮。</p><p>然后页面下方可见新建的密码，然后将【值】复制记录下来！后面会用到！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/384eaf1a8e2c21d490fa271af05e57ba.png" alt="8" title="8"><br>7）我们利用rclone来获取Token!</p><p>下载rclone（【rclone下载地址1】【rclone下载地址2】）到电脑某个盘符下，在rclone.exe同目录中，按Shift+鼠标右键，选择在【此处打开cmd窗口】或【在此处打开power shell窗口】</p><p>然后在弹出执行命令！</p><pre><code>./rclone authorize &quot;onedrive&quot; &quot;应用程序(客户端)ID&quot; &quot;应用程序密码&quot;
</code></pre><p>本文演示的ID和密码！</p><pre><code>./rclone authorize &quot;onedrive&quot; &quot;c33b7c34-2d87-4b89-89f0-469d6e78a55e&quot; &quot;P~0zNhn1e._BD.6~xxxxxxx~Ced9JR3&quot;
</code></pre><p>执行命令后弹出网页登陆E5管理账号，然后接受授权即可！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/88caaf99e0140e0891e01d4e4fc37f0d.png" alt="9" title="9"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/d7f39360c2c7088e4c00874a1fa3deae.png" alt="10" title="10"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/dca231f1fd57293961ccab7a16d42d21.png" alt="11" title="11"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/a1c8603ada17ee85481c0503e49d58a1.png" alt="12" title="12"></p><p>8）授权成功后，窗口弹出得到的Token信息！复制内容</p><p>仅复制 【Paste the following into your remote machine —&gt;】开头【&lt;—End paste】结尾的中间部分内容！</p><p>利用搜索引擎找一个【JSON在线格式】的网站，将复制的内容格式化一下。复制refresh_token值内容！不要双引号！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/020571d9071e1aaa9778ef7de0179c79.png" alt="13" title="13"></p><p>因为码农经常看一些JSON，我的Chrome安装了一个扩展 JSON-handle【<a href="https://chrome.google.com/webstore/detail/json-handle/iahnhfdhidomcpggpaimmmahffihkfnj">安装地址</a>】。很清晰看到我们要复制的内容！如图选中部分内容~！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/cf96d18ab30de62b6e2b2a0cf7d01b4b.png" alt="16" title="16"></p><p>克隆项目<br>这里利用的是Github的私有项目来做，如果你认为无所谓可以直接fork原作者的项目！然后直接跳过本节！</p><p>1）登陆Github账号，新建项目（ New repository）！</p><p>名称随便，可设置为私有(Private)，想公开项目也行。</p><p>为了安全还是私有吧！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/20d77f26436e9b79484036c174179a50.png" alt="17" title="17"></p><p>2）项目新建成功后，我们选择Import 导入一个项目！</p><p>项目地址：<a href="https://github.com/wangziyingwen/AutoApiSecret">https://github.com/wangziyingwen/AutoApiSecret</a></p><p>或者导入：<a href="https://github.com/malaohu/AutoApiSecret">https://github.com/malaohu/AutoApiSecret</a></p><p>导入的过程略慢！需要多等等！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/a26277dae76951ae46891eb8b625f830.png" alt="18" title="18"></p><p>配置参数<br>1）在线编辑你项目里的1.txt 文件，将整个refresh_token覆盖粘贴进去（原内容不要保留）。</p><p>2）依次点击上栏 【Setting】-&gt; 【Secrets】 -&gt; 【Add a new secret】</p><p>分别新建：CONFIG_ID、CONFIG_KEY</p><p>替换你的ID 和 密码！一定要注意前面r 和 单引号！</p><p>CONFIG_ID</p><pre><code>id=r&#039;应用程序(客户端)ID&#039;
</code></pre><p>CONFIG_KEY</p><pre><code>secret=r&#039;应用程序密码&#039;
</code></pre><p><img src="https://pic.rmb.bdstatic.com/bjh/77a4b42ecff7bc881a79a864bae13713.png" alt="19" title="19"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/b4a8df2222885fb1617aa9f2e362d97c.png" alt="20" title="20"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/97cdcf60d5cc492440ff0847a127c377.png" alt="21" title="21"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/503aef93b6112dd50808aaec64b5667f.png" alt="22" title="22"></p><p>3）打开地址：<a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a> 点击【Generate new token】</p><p>设置名字：GITHUB_TOKEN ,</p><p>勾选 repo , admin:repo_hook , workflow 等选项，点击按钮【Generate token】！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/c527e37ac2b38c30aff8feac05c18888.png" alt="23" title="23"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/eed579c628de7661961a745e333868e6.png" alt="24" title="24"></p><p>4）修改1.txt</p><p>把原有的删掉，用之前获取到的refresh_token替换掉</p><p>5）测试运行</p><p>点击一下Github项目的星星（Star）立马调用一次脚本，再点击上面的【Action】就能看到每次的运行日志，看看运行状况！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/80a4ea2c442af210dcee41dbd98eb7e6.png" alt="25" title="25"></p><p>如图展示日志，说明成功啦！！3小时后再确认下是否自动运行了（ation里是否多出来几个），是的话就不用管了！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/4561d24763217a923747cc32173d5814.png" alt="26" title="26"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/3ce21cbcd55c38a6c2a904ab73473ea8.png" alt="27" title="27"></p><p>最后说明</p><p>&lt;!--more--&gt;</p><p>1）复制各种ID，密码，Token的时候一定要多注意！多个空格，少个标点符号都导致无法运行！</p><p>2）项目设定每3小时自动运行一次，每次调用3轮。定时自动启动修改地方文件 .github/workflow/AutoApiSecret.yml（自行百度cron定时任务格式，最短每5分钟一次）私有仓库有限制谨慎修改！</p><p>3）无论怎么刷API也不能100%保证能续订服务！！！</p><p>4）自动运行会更新1.txt文件，会生成好多无用的提交记录，可能影响使用Github!</p><p>Github Action<br>Github Action 提供的虚拟环境： 2core CPU · 7 GB RAM 内存 · 14 GB SSD 硬盘空间</p><p>使用限制：</p><p>&lt;!--more--&gt;</p><p>每个仓库只能同时支持20个 workflow 并行。<br>每小时可以调用1000次 GitHub API 。<br>每个 job 最多可以执行6个小时。<br>免费版的用户最大支持20个 job 并发执行，macOS 最大只支持5个。<br>私有仓库每月累计使用时间为2000分钟，超过后$ 0.008/分钟，公共仓库则无限制。</p><p>其他续订方法：</p><p>OD:<br>onedrive mover.io fast.io 各种列表程序等等</p><p>邮件:<br><a href="https://github.com/iyear/E5SubBot">https://github.com/iyear/E5SubBot</a></p><p>Onenote:<br><a href="http://note.0907.org">http://note.0907.org</a></p><p>订阅添合作伙伴码：<br>6207209</p><p>原文链接：<a href="https://51.ruyo.net/15646.html">原文</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/228/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>免费申请Microsoft 365 E5开发者试用订阅</title>
<link>https://eblog.ink/archives/227/</link>
<guid>https://eblog.ink/archives/227/</guid>
<pubDate>Mon, 29 Jun 2020 05:19:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[微软账号需要先注册一个微软个人账号，如果已经有了就跳过这一步！填写注册信息很轻松完成！特别提醒一下，需要到：https://account.microsoft.com/profile  维护自己...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>微软账号</p><p>需要先注册一个微软个人账号，如果已经有了就跳过这一步！填写注册信息很轻松完成！</p><p>特别提醒一下，需要到：<a href="https://account.microsoft.com/profile">https://account.microsoft.com/profile</a>  维护自己用户名等信息，否则无法进行下一步！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/a756c237271553818af9ed2c4b59f700.png" alt="注册界面" title="注册界面"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/a1351cc4de1e49589295a94a5339a3f0.png" alt="注册界面2" title="注册界面2"></p><p>申请试用<br>开通Office开发者账号！申请地址：<a href="https://developer.microsoft.com/en-us/office/profile/">https://developer.microsoft.com/en-us/office/profile/</a></p><p>完善相关信息，国家建议选择美国</p><p><img src="https://pic.rmb.bdstatic.com/bjh/5080f12799ca3ea0fb374fc37deb812b.png" alt="申请界面1" title="申请界面1"></p><p>下面是勾选你要使用那些功能。不知道怎么勾选那就全勾选吧！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/c54b0c9a457ca961e935864f477c9e84.png" alt="申请界面2" title="申请界面2"></p><p><img src="https://pic.rmb.bdstatic.com/bjh/644b09bb71493f3a756c3309c1288afc.png" alt="申请界面3" title="申请界面3"></p><p>开通订阅<br>点击【SET UP E5 SUBSCRIPTION】填写要申请的订阅信息！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/abffbb92b401f263706d403d46a0dc1f.png" alt="开通界面1" title="开通界面1"></p><p>手机接收验证码，验证一下！（国内外手机均可！）</p><p><img src="https://pic.rmb.bdstatic.com/bjh/53344988eaeb486f2190ede03ab781c4.png" alt="验证界面1" title="验证界面1"></p><p>提交稍等一会儿，就提示成功啦！</p><p><img src="https://pic.rmb.bdstatic.com/bjh/43fda923ffa55f3db67881c51ad4d231.png" alt="订阅界面1" title="订阅界面1"></p><p>管理平台</p><p>管理平台 地址：<a href="https://portal.office.com/">https://portal.office.com/</a></p><p>使用订阅许可账号（邮箱以onmicrosoft.com结尾的账号）</p><p>订阅详情<br>本订阅主要是支持 OFFICE 365桌面版！其次是支持OneDrive网盘！</p><p>注意事项<br>1）无法接收短信验证码？开启全局代理或者换个手机号码！</p><p>2）每个子账号最多可以在 5 台电脑或 Mac、5 个平板电脑以及智能手机上安装 Office登陆。</p><p>3）无法申请？将开启浏览器隐私模式或者换其他国外的全局代理！</p><p><strong>原文地址</strong>：<a href="https://51.ruyo.net/16002.html">原文</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/227/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>Office 子号批量解除阻止登录</title>
<link>https://eblog.ink/archives/226/</link>
<guid>https://eblog.ink/archives/226/</guid>
<pubDate>Fri, 19 Jun 2020 04:01:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[面那个使用用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块。若要解除阻止该文本文件中列出的帐户，请运行以下命令：Get-Co...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>面那个使用用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块。</p><p>若要解除阻止该文本文件中列出的帐户，请运行以下命令：</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-MsolUser -UserPrincipalName $_ -BlockCredential $false }




</code></pre><p>补充<br>要先安装好模块，PowerShell版本要5以上</p><p>下载安装官方提供的<a href="http://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185">Azure Active Directory Connection</a> </p><p>请在本地用管理员身份打开PowerShell，并运行命令 <code>Install-Module -Name AzureAD</code></p><p>下载安装官方提供的<a href="https://go.microsoft.com/fwlink/p/?LinkId=286152">Microsoft Online Service Sign-in Assistant for IT Professionals</a> </p><p>连接到MSOL</p><pre><code>Connect-MsolService
</code></pre><p>列出所有被禁用户（手动操作一下，放进Accounts.txt）</p><pre><code>Get-MsolUser -ALL  -EnabledFilter DisabledOnly
</code></pre><p>解除</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-MsolUser -UserPrincipalName $_ -BlockCredential $false }


</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/226/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>连接到 Office 365 租户</title>
<link>https://eblog.ink/archives/225/</link>
<guid>https://eblog.ink/archives/225/</guid>
<pubDate>Wed, 10 Jun 2020 07:46:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[1.连接到 Azure Active Directory PowerShell Graph 模块步骤 1：安装所需软件这些步骤只需在您的计算机上执行一次即可，而不是在每次连接时都要求执行。但是，...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>1.连接到 Azure Active Directory PowerShell Graph 模块</p><p>步骤 1：安装所需软件</p><p>这些步骤只需在您的计算机上执行一次即可，而不是在每次连接时都要求执行。但是，您可能需要定期安装较新版本的软件。</p><p>打开提升的 Windows PowerShell 命令提示符（以管理员身份运行 Windows PowerShell）。</p><p>在"管理员: Windows PowerShell"命令窗口中，运行以下命令：</p><pre><code>Install-Module -Name AzureAD</code></pre><p>果系统提示从不受信任的存储库安装模块，请键入 Y，然后按 Enter 键。</p><p>步骤 2：连接到 Office 365 订阅的 Azure AD</p><p>若要使用帐户名称和密码或者多重身份验证 (MFA) 连接到 Office 365 订阅的 Azure AD，请在 Windows PowerShell 命令提示符中运行这些命令之一（不必进行提升）。</p><pre><code>Office 365 云    命令
Office 365 全球 (+GCC)    Connect-AzureAD
由世纪互联运营的 Office 365    Connect-AzureAD -AzureEnvironmentName AzureChinaCloud
Office 365 德国    Connect-AzureAD -AzureEnvironmentName AzureGermanyCloud
Office 365 美国政府版 DoD 和 Office 365 美国政府版 GCC 高    Connect-AzureAD -AzureEnvironmentName AzureUSGovernment
</code></pre><p>在“登录到你的帐户”对话框中，键入 Office 365工作或学校帐户用户名和密码，再单击“确定”。<br>如果使用的是 MFA，请按照其他对话框中的说明提供更多身份验证信息，例如验证码。<br>连接后，可对 <a href="https://docs.microsoft.com/en-us/powershell/module/Azuread/?view=azureadps-2.0">Azure Active Directory PowerShell Graph</a> 模块使用这些 cmdlet。</p><p>与用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块连接<br>用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块中的命令在其 cmdlet 名称中具有 Msol。</p><p>PowerShell 版本 7 不支持用于 Windows PowerShell 模块和 cmdlet 的其名称中包含 Msol 的 Microsoft Azure Active Directory 模块。 对于 PowerShell 版本 7 和更高版本，必须使用 Azure Active Directory PowerShell for Graph 模块或 Azure PowerShell。</p><p>PowerShell Core 不支持用于 Windows PowerShell 模块和 cmdlet 的其名称中包含 Msol 的 Microsoft Azure Active Directory 模块。 若要继续使用这些 cmdlet，必须从 Windows PowerShell 运行它们。</p><p>步骤 1：安装所需软件</p><p>些步骤只需在您的计算机上执行一次即可，而不是在每次连接时都要求执行。但是，您可能需要定期安装较新版本的软件。</p><p>安装 64 位版 Microsoft Online Services 登录助手：<a href="https://www.microsoft.com/en-us/download/details.aspx?id=41950">适用于 IT 专业人员 RTW 的 Microsoft Online Services 登录助手</a>。</p><p>安装用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块，具体步骤如下：</p><p>打开提升的 Windows PowerShell 命令提示符（以管理员身份运行 Windows PowerShell）。</p><p>运行 Install-Module MSOnline 命令。</p><p>如果系统提示安装 NuGet 提供程序，请键入 Y，然后按 Enter 键。<br>如果系统提示从 PSGallery 安装模块，请键入 Y，然后按 Enter 键。</p><p>步骤 2：连接到 Office 365 订阅的 Azure AD</p><p>若要使用帐户名称和密码或者多重身份验证 (MFA) 连接到 Office 365 订阅的 Azure AD，请在 Windows PowerShell 命令提示符中运行这些命令之一（不必进行提升）。</p><p>表 2</p><p>Office 365 云    命令<br>Office 365 全球 (+GCC)    Connect-MsolService<br>由世纪互联运营的 Office 365    Connect-MsolService -AzureEnvironment AzureChinaCloud<br>Office 365 德国    Connect-MsolService -AzureEnvironment AzureGermanyCloud<br>Office 365 美国政府版 DoD 和 Office 365 美国政府版 GCC 高    Connect-MsolService -AzureEnvironment USGovernment</p><p>在“登录到你的帐户”对话框中，键入 Office 365工作或学校帐户用户名和密码，再单击“确定”。<br>如果使用的是 MFA，请按照其他对话框中的说明提供更多身份验证信息，例如验证码。</p><p>以上内容参考:<a href="https://docs.microsoft.com/zh-cn/office365/enterprise/powershell/connect-to-office-365-powershell#connect-with-the-azure-active-directory-powershell-for-graph-module">链接</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/225/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>用 Office 365 PowerShell 冻结用户账户</title>
<link>https://eblog.ink/archives/224/</link>
<guid>https://eblog.ink/archives/224/</guid>
<pubDate>Wed, 10 Jun 2020 07:45:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[使用用于图表模块的 Azure Active Directory PowerShell首先连接到 Office365租户阻止对单个用户帐户的访问使用以下语法来阻止单个用户帐户：Set-Azure...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p><strong>使用用于图表模块的 Azure Active Directory PowerShell</strong></p><p>首先连接到 <a href="https://eblog.ink/archives/225/">Office365租户</a></p><p>阻止对单个用户帐户的访问</p><p>使用以下语法来阻止单个用户帐户：</p><pre><code>Set-AzureADUser -ObjectID &lt;sign-in name of the user account&gt; -AccountEnabled $false
</code></pre><p>此示例阻止访问用户帐户 <a href="mailto:fabricec@litwareinc.com">fabricec@litwareinc.com</a>。</p><pre><code>Set-AzureADUser -ObjectID fabricec@litwareinc.com -AccountEnabled $false
</code></pre><p>若要取消阻止此用户帐户，请运行以下命令：</p><pre><code>Set-AzureADUser -ObjectID fabricec@litwareinc.com -AccountEnabled $true
</code></pre><p>若要根据用户的显示名称显示用户帐户 UPN，请使用以下命令：</p><pre><code>$userName=&quot;&lt;display name&gt;&quot;
Write-Host (Get-AzureADUser | where {$_.DisplayName -eq $userName}).UserPrincipalName</code></pre><p>本示例显示名为 Caleb Sills 的用户的用户帐户 UPN。</p><pre><code>$userName=&quot;Caleb Sills&quot;
Write-Host (Get-AzureADUser | where {$_.DisplayName -eq $userName}).UserPrincipalName
</code></pre><p>若要基于用户的显示名称阻止某个帐户，请使用以下命令：</p><pre><code>$userName=&quot;&lt;display name&gt;&quot;
Set-AzureADUser -ObjectID (Get-AzureADUser | where {$_.DisplayName -eq $userName}).UserPrincipalName -AccountEnabled $false
</code></pre><p>在任何时候，都可以使用以下命令检查用户帐户的阻止状态：</p><pre><code>Get-AzureADUser -UserPrincipalName &lt;UPN of user account&gt; | Select DisplayName,AccountEnabled</code></pre><p>阻止对多个用户帐户的访问</p><pre><code>akol@contoso.com
tjohnston@contoso.com
kakers@contoso.com</code></pre><p>在以下命令中，示例文本文件为 C:\My Documents\Accounts.txt。 将此替换为您的文本文件的路径和文件名。</p><p>若要阻止访问该文本文件中列出的帐户，请运行以下命令：</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-AzureADUSer -ObjectID $_ -AccountEnabled $false }
</code></pre><p>若要解除阻止该文本文件中列出的帐户，请运行以下命令：</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-AzureADUSer -ObjectID $_ -AccountEnabled $true }
</code></pre><p><strong>使用用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块。</strong></p><p>首先，连接到 <a href="https://eblog.ink/archives/225/">Office 365 租户</a></p><p>阻止对单个用户帐户的访问</p><p>使用以下语法来阻止对单个用户帐户的访问</p><pre><code>Set-MsolUser -UserPrincipalName &lt;sign-in name of user account&gt;  -BlockCredential $true</code></pre><p>此示例阻止访问用户帐户 <a href="mailto:fabricec@litwareinc.com">fabricec@litwareinc.com</a>。</p><pre><code>Set-MsolUser -UserPrincipalName fabricec@litwareinc.com -BlockCredential $true</code></pre><p>若要取消阻止该用户帐户，请运行以下命令：</p><pre><code>Set-MsolUser -UserPrincipalName &lt;sign-in name of user account&gt;  -BlockCredential $false
</code></pre><p>在任何时候，都可以使用以下命令检查用户帐户的阻止状态：</p><pre><code>Get-MsolUser -UserPrincipalName &lt;sign-in name of user account&gt; | Select DisplayName,BlockCredential</code></pre><p>阻止对多个用户帐户的访问</p><p>首先，创建一个文本文件，其中每行包含一个帐户，如下所示</p><pre><code>akol@contoso.com
tjohnston@contoso.com
kakers@contoso.com</code></pre><p>在以下命令中，示例文本文件为 C:\My Documents\Accounts.txt。 将此替换为您的文本文件的路径和文件名。</p><p>若要阻止访问该文本文件中列出的帐户，请运行以下命令：</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-MsolUser -UserPrincipalName $_ -BlockCredential $true }</code></pre><p>若要解除阻止该文本文件中列出的帐户，请运行以下命令：</p><pre><code>Get-Content &quot;C:\My Documents\Accounts.txt&quot; | ForEach { Set-MsolUser -UserPrincipalName $_ -BlockCredential $false }
</code></pre><p>参考：<a href="https://docs.microsoft.com/zh-cn/office365/enterprise/powershell/block-user-accounts-with-office-365-powershell#use-the-azure-active-directory-powershell-for-graph-module">链接1</a><br>参考：<a href="https://docs.microsoft.com/zh-cn/office365/enterprise/powershell/manage-user-accounts-and-licenses-with-office-365-powershell">链接2</a><br>参考：<a href="https://docs.microsoft.com/zh-cn/office365/enterprise/powershell/manage-office-365-with-office-365-powershell">链接3</a><br>参考：<a href="https://docs.microsoft.com/zh-cn/office365/enterprise/powershell/getting-started-with-office-365-powershell">链接4</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/224/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>用Windows PowerShell来批量创建Office 365（各种订阅）用户</title>
<link>https://eblog.ink/archives/223/</link>
<guid>https://eblog.ink/archives/223/</guid>
<pubDate>Wed, 10 Jun 2020 07:27:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[首先你的电脑要能运行Windows PowerShell，win10的话，在左下角图标上右键，选择Windows PowerShell（管理员）步骤 1：安装所需软件Install-Module...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>首先你的电脑要能运行Windows PowerShell，win10的话，在左下角图标上右键，选择Windows PowerShell（管理员）</p><p>步骤 1：安装所需软件</p><pre><code>Install-Module -Name AzureAD
</code></pre><p>步骤 2：连接到 Office 365 订阅的 Azure AD</p><pre><code>Connect-AzureAD
</code></pre><p>与用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块连接</p><p>步骤 1：安装所需软件</p><pre><code>Install-Module MSOnline</code></pre><p>出现提示时选择A</p><p>好了，完成上面的环境安装后，我们就可以开始操作了</p><pre><code>Connect-MsolService
</code></pre><p>这时会让你输入账号密码，注意需要有管理权限的（或者具有创建用户权限的管理员）</p><p>登陆成功后，我们就能开始操作了</p><p>我在这里给出我用的代码</p><pre><code>Import-Csv -Path &quot;C:\Users\Administrator\Desktop\001.csv&quot; | foreach {New-MsolUser -DisplayName $_.DisplayName -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $_.UserPrincipalName -UsageLocation $_.UsageLocation -LicenseAssignment $_.AccountSkuId} | Export-Csv -Path &quot;C:\Users\Administrator\Desktop\NewAccountResults.csv&quot;</code></pre><p>这个代码大概的意思是，读取的是我桌面（C:UsersAdministratorDesktop）的001.csv这个文件，并将结果记录在桌面（C:UsersAdministratorDesktop）的这个NewAccountResults.csv 文件中，大家在使用的时候可以自行修改这两个路径</p><p>这里转载了个csv：<a href="https://kingq.lanzous.com/irWXMdiw2ej">点击下载</a></p><p>如果你使用我的csv文件，还需要进行修改一些内容</p><p>csv文件由5个部分组成</p><p>打开提供的csv文件，UserPrincipalName（就是用户的登陆邮箱）需要修改一下，把后缀修改为你的域名后缀就可以了<br>用excel的话，直接按ctrl+h，按操作（其中xxxxxxx.com代表你绑定在Office 365的域名）</p><p>除了UserPrincipalName，你还需要修改LicenseAssignment，就是你要分配给用户什么许可证</p><p>提供的的csv文件里面是这样的</p><pre><code>microsoft:STANDARDWOFFPACK_STUDENT</code></pre><p>前面这个microsoft，你需要修改为微软给你的二级域名的前面那部分<br>例如我的是这个<a href="mailto:admin@knauniversity.onmicrosoft.com">admin@knauniversity.onmicrosoft.com</a><br>就需要把microsoft修改为knauniversity（批量修改的方法在前面有，ctrl+h）</p><p>后面这个STANDARDWOFFPACK_STUDENT，代表的是学生许可证<br>如果你想添加教师，就改为STANDARDWOFFPACK_FACULTY</p><p>你也可以在Windows PowerShell使用下面这个命令来看你的订阅</p><pre><code>Get-MsolAccountSku</code></pre><p>这些都做好了，就可以真正的开始跑脚本了</p><pre><code>Import-Csv -Path &quot;C:\Users\Administrator\Desktop\001.csv&quot; | foreach {New-MsolUser -DisplayName $_.DisplayName -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $_.UserPrincipalName -UsageLocation $_.UsageLocation -LicenseAssignment $_.AccountSkuId} | Export-Csv -Path &quot;C:\Users\Administrator\Desktop\NewAccountResults.csv&quot;
</code></pre><p>这是我用的脚本，具体要修改的地方就两个，在文章开头也说过了，前面那个路径代表你的csv的位置，后面那个路径是储存你创建的用户信息的位置</p><p>转自:<a href="https://www.zxd.win/16.html">https://www.zxd.win/16.html</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/223/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
<item>
<title>关闭office账户的强制Microsoft Authenticator 验证登录</title>
<link>https://eblog.ink/archives/222/</link>
<guid>https://eblog.ink/archives/222/</guid>
<pubDate>Mon, 08 Jun 2020 02:44:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[office 365账户有时候不知道怎么微软就强制给你启用了安全验证登录。非让你下载一个Authenticator软件来辅助登录。一开始以为是Azure多重身份验证结果关了，没用!!解决方法：1...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>office 365账户有时候不知道怎么微软就强制给你启用了安全验证登录。</p><p>非让你下载一个Authenticator软件来辅助登录。</p><p>一开始以为是Azure多重身份验证结果关了，没用!!</p><p>解决方法：</p><pre><code>1.打开管理后台。
2.点击Azure Active Directory
3.再次点击Azure里面的Azure Active Directory
4.点击：属性
5.点击下方的：管理安全默认值
6.修改安全默认值为：否（随便选一个理由）

</code></pre><p>一般情况问题就可以解决了</p>
]]></content:encoded>
<slash:comments>3</slash:comments>
<comments>https://eblog.ink/archives/222/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/office%E7%AE%A1%E7%90%86/</wfw:commentRss>
</item>
</channel>
</rss>