O365 - yusukew62/docs GitHub Wiki

O365

Office 365認定試験

1.Office 365の管理

1-1.Office アプリケーション

office 365 ProPlus

office展開ツール(ODT)

office 展開ツールの設定ファイル(configuration.xml)

<!-- Office 365 client configuration file sample. To be used for Office 365 ProPlus 2016 apps, 
     Office 365 Business 2016 apps, Project Pro for Office 365 and Visio Pro for Office 365. 

     For detailed information regarding configuration options visit: http://aka.ms/ODT. 
     To use the configuration file be sure to remove the comments

     For Office 365 client apps (verion 2013) you will need to use the 2013 version of the 
     Office Deployment Tool which can be downloaded from http://aka.ms/ODT2013

     The following sample allows you to download and install Office 365 ProPlus 2016 apps 
     and Visio Pro for Office 365 directly from the Office CDN using the Current Channel
     settings  -->



<Configuration>

  <Add OfficeClientEdition="32" Channel="Monthly">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />
    </Product>
    <Product ID="VisioProRetail">
      <Language ID="en-us" />
    </Product>
  </Add>

  <!--  <Updates Enabled="TRUE" Channel="Monthly" /> -->

  <!--  <Display Level="None" AcceptEULA="TRUE" />  -->

  <!--  <Property Name="AUTOACTIVATE" Value="1" />  -->

</Configuration>

office展開ツールの実行

C:\Users\Yusuke\Desktop\O365>setup.exe /download configuration.xml

C:\Users\Yusuke\Desktop\O365>setup.exe /configure configuration.xml

office構成アナライザツール(offCAT)

office構成アナライザツールの実行例

C:\Users\Yusuke\AppData\Local\Microsoft\OffCAT>OffCATcmd.exe -dat C:\Users\Yusuke\Desktop\yusukew62.offx -cfg Outlook -AE -NoRTS

以下のような出力がされる

C:\Users\Yusuke\AppData\Local\Microsoft\OffCAT>OffCATcmd.exe -dat C:\Users\Yusuke\Desktop\yusukew62.offx -cfg Outlook -AE -NoRTS
11:08:15.362: Cannot call the Outlook Object Model (-2147221021). Going for an offline scan.
11:08:17.671: Command-line: -dat C:\Users\Yusuke\Desktop\yusukew62.offx -cfg Outlook -AE
11:08:19.901: Starting Collecting Data phase.
(省略)
11:13:23.679: Starting Postprocessing Rules phase.
11:13:24.303: Completed Postprocessing Rules phase.
11:13:26.190: Saving data to file C:\Users\Yusuke\Desktop\yusukew62.offx

作成された offxファイルを実行すると OffCATツールが開き、レポート情報を確認できる

1-2.Office テレメトリ

管理用テンプレート設定

管理用テンプレート「 Office 2016 Administrative Template files (ADMX/ADML) and Office Customization Tool 」のダウンロード

ダウンロードファイルを展開し、以下へ保存

admxファイルの保存先

C:\Windows\PolicyDefinitions

ja-jpディレクトリ直下のadmlファイルの保存先

C:\Users\Yusuke\Desktop\admx\ja-jp

ローカルグループポリシーエディタ(gpedit.msc)を開き、以下のパスへ移動

ユーザーの管理\管理用テンプレート\Microsoft Office 2016\テレメトリ ダッシュボード

以下の設定を有効にする

  • テレメトリ データの収集をオンにする
  • Office テレメトリ エージェントのデータ アップロードをオンにする

テレメトリダッシュボードの起動

cd C:\Program Files (x86)\Microsoft Office\root\Office16\1041
TelemetryDashboard.xltx

1-3.全体管理

PowerShellのバージョンアップ前

PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.8762
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

PowerShellのバージョンアップ後

PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

MSOnlineのインストール

PS C:\WINDOWS\system32> Install-Module MSOnline

続行するには NuGet プロバイダーが必要です
PowerShellGet で NuGet ベースのリポジトリを操作するには、'2.8.5.201' 以降のバージョンの NuGet
プロバイダーが必要です。NuGet プロバイダーは 'C:\Program Files\PackageManagement\ProviderAssemblies' または
'C:\Users\Yusuke\AppData\Local\PackageManagement\ProviderAssemblies' に配置する必要があります。'Install-PackageProvider
 -Name NuGet -MinimumVersion 2.8.5.201 -Force' を実行して NuGet プロバイダーをインストールすることもできます。今すぐ
PowerShellGet で NuGet プロバイダーをインストールしてインポートしますか?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

手順 1: 必要なソフトウェアをインストール

PS C:\WINDOWS\system32> Get-Help New-MsolLicenseOptions

NAME
    New-MsolLicenseOptions

(割愛)

手順 2: Office 365 サブスクリプションに接続

下記コマンドを実行すると、認証画面が表示されるため、IDとPWを入力する
IDはO365管理者アカウント「[email protected]」とそのPWを入力する

PS C:\WINDOWS\system32> $UserCredential = Get-Credential

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential

下記コマンドを実行する

PS C:\WINDOWS\system32> Connect-MsolService -Credential $UserCredential
PS C:\WINDOWS\system32>

動作確認

PS C:\WINDOWS\system32> Get-MsolUser

UserPrincipalName                         DisplayName     isLicensed
-----------------                         -----------     ----------
taro-yamada@yusukew62.onmicrosoft.com Yamada Taro True
administrator@yusukew62.onmicrosoft.com   山田太郎        True

Office 365 PowerShell を使ったサービスへのアクセスを無効にする

PS C:\WINDOWS\system32> Get-MsolAccountSku

AccountSkuId             ActiveUnits WarningUnits ConsumedUnits
------------             ----------- ------------ -------------
yusukew62:ENTERPRISEPACK 25          0            3            

Office 365 PowerShell でライセンスとサービスを確認する

PS C:\WINDOWS\system32> Get-MsolAccountSku | Select -ExpandProperty ServiceStatus

ServicePlan           ProvisioningStatus
-----------           ------------------
BPOS_S_TODO_2         Success           
FORMS_PLAN_E3         Success           
STREAM_O365_E3        Success           
Deskless              Success           
FLOW_O365_P2          Success           
POWERAPPS_O365_P2     Success           
TEAMS1                Success           
PROJECTWORKMANAGEMENT Success           
SWAY                  Success           
INTUNE_O365           PendingActivation 
YAMMER_ENTERPRISE     Success           
RMS_S_ENTERPRISE      Success           
OFFICESUBSCRIPTION    Success           
MCOSTANDARD           Success           
SHAREPOINTWAC         Success           
SHAREPOINTENTERPRISE  Success           
EXCHANGE_S_ENTERPRISE Success           
PS C:\WINDOWS\system32> $LO = New-MsolLicenseOptions -AccountSkuId yusukew62:ENTERPRISEPACK -DisabledPlans YAMMER_ENTERPRISE
PS C:\WINDOWS\system32> $LO

ExtensionData AccountSkuId                                         DisabledServicePlans
------------- ------------                                         --------------------
              Microsoft.Online.Administration.AccountSkuIdentifier {YAMMER_ENTERPRISE} 



PS C:\WINDOWS\system32> Set-MsolUserLicense -UserPrincipalName [email protected] -LicenseOptions $LO

1-4.ユーザー管理

1-5.管理者役割

1-6.ディレクトリ同期

1-7.カスタムドメイン名の使用

1-8.Microsoft Azure Rights Management Service (Azure RMS)

1-9.Active Directory フェデレーション サービス (AD FS)

1-10.多要素認証

1-11.トラブルシューティング

2.Exchange Online

2-1.Exchange Online管理の基礎

PS C:\Users\Yusuke> $UserCredential = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
PS C:\Users\Yusuke> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

PS C:\Users\Yusuke> Import-PSSession $Session
WARNING: The names of some imported commands from the module 'tmp_olsoxtkx.1zo' include unapproved verbs that might make them less disc
overable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of app
roved verbs, type Get-Verb.

ModuleType Version    Name                                ExportedCommands                                                            
---------- -------    ----                                ----------------                                                            
Script     1.0        tmp_olsoxtkx.1zo                    {Add-AvailabilityAddressSpace, Add-DistributionGroupMember, Add-MailboxFo...

2-2.メールボックスの管理

2-3.コンプライアンス

2-4.メールボックス移行

2-5.フィルター設定

2-6.応用的なPowerShellコマンドレット

3.Skype for Business Online

3-1.Skype for Business Online 管理の基礎

Visual Studio 2017をインストール後、Skype for Business Onlineをインストールする
※ Visual C++ Runtime 環境がインストールされていないとインストール時にエラーになる

Import-Module で SkypeOnlineConnector をインストールしようとすると、PowerShell のセキュリティエラーになる
参考: WindowsでPowerShellスクリプトの実行セキュリティポリシーを変更する

PS C:\Users\Yusuke> Import-Module SkypeOnlineConnector
Import-Module : File C:\Program Files\Common Files\Skype for Business Online\Modules\SkypeOnlineConnector\SkypeOnline
ConnectorStartup.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module SkypeOnlineConnector
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand

現在の実行ポリシーを確認する

PS C:\Users\Yusuke> Get-ExecutionPolicy
Restricted

Set-ExecutionPolicy で実行ポリシーを変更しようとしたらエラーが出た

PS C:\Users\Yusuke> Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy : レジストリ キー 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' へのア
クセスが拒否されました。 To change the execution policy for the default (LocalMachine) scope, start Windows PowerShell with the "
Run as administrator" option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope Cu
rrentUser".
At line:1 char:1
+ Set-ExecutionPolicy RemoteSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCom 
   mand

-Scope CurrentUser としたら実行できた

PS C:\Users\Yusuke> Set-ExecutionPolicy -Scope CurrentUser
cmdlet Set-ExecutionPolicy at command pipeline position 1
Supply values for the following parameters:
ExecutionPolicy: RemoteSigned

RemoteSigned に変更できた

PS C:\Users\Yusuke> Get-ExecutionPolicy
RemoteSigned

SkypeOnlineConnector のインストールができた

PS C:\Users\Yusuke> Import-Module SkypeOnlineConnector

クレデンシャルを取得

PS C:\Users\Yusuke> $credential = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:

Skype for Business Online へセッション接続

PS C:\Users\Yusuke> $session = New-CsOnlineSession -Credential $credential
WARNING: 

PS C:\Users\Yusuke>  Import-PSSession $session

ModuleType Version    Name                                ExportedCommands                                           
---------- -------    ----                                ----------------                                           
Script     1.0        tmp_mh55wzod.oqo                    {Clear-CsOnlineTelephoneNumberReservation, Complete-CsCc...

テナント内でアカウントを持つユーザーの一覧表示

PS C:\Users\Yusuke>  Get-CsOnlineUser | select DisplayName,Enabled,SipAddress

DisplayName     Enabled SipAddress                                   
-----------     ------- ----------                                   
Watanabe Yusuke    True sip:yusuke-watanabe@yusukew62.onmicrosoft.com
Watanabe Azusa     True sip:azusa@yusukew62.onmicrosoft.com          
渡邉祐輔               True sip:administrator@yusukew62.onmicrosoft.com  

3-2.外部通信

3-3.Skype for Business Online のコマンドレット

3-4.その他

4.SharePoint Online

4-1.SharePoint Online管理の基礎

SharePoint Online Management Shell をダウンロードし、インストールする

接続作業を行う

PS C:\WINDOWS\system32> Connect-SPOService -Url https://yusukew62-admin.sharepont.com -credential administrator@yusukew62.onmicrosoft.com

認証ダイアログが表示されるため、PWを入力する

PS C:\WINDOWS\system32> Get-SPOSite

Url                                                Owner Storage Quota
---                                                ----- -------------
https://yusukew62.sharepoint.com/search                       26214400
https://yusukew62.sharepoint.com/                             26214400
https://yusukew62.sharepoint.com/portals/Community            26214400
https://yusukew62.sharepoint.com/portals/hub                  26214400
https://yusukew62-my.sharepoint.com/                          26214400

新規にサイトを作成

PS C:\WINDOWS\system32> New-SPOSite -Url https://yusukew62.sharepoint.com/sites/test_page -Owner yusuke-watanabe@yusukew62.onmicrosoft.com -StorageQuota 1000 -ResourceQuota 300 -Title "Test Site"

作成されたサイトを確認する

PS C:\WINDOWS\system32> Get-SPOSite

Url                                                Owner                                     Storage Quota
---                                                -----                                     -------------
https://yusukew62.sharepoint.com/search                                                           26214400
https://yusukew62.sharepoint.com/sites/test_page   yusuke-watanabe@yusukew62.onmicrosoft.com          1024
https://yusukew62.sharepoint.com/                                                                 26214400
https://yusukew62.sharepoint.com/portals/Community                                                26214400
https://yusukew62.sharepoint.com/portals/hub                                                      26214400
https://yusukew62-my.sharepoint.com/                                                              26214400

既存サイトのリソースクォータとストレージクォータの設定変更

PS C:\WINDOWS\system32> Set-SPOSite -Identity https://yusukew62.sharepoint.com/sites/test_page -ResourceQuota 100 -Stora
geQuota 100

4-2.権限設定

4-3.外部共有

4-4.電子情報開示センター

4-5.コンテンツ管理

利用できるテンプレート一覧はGet-SPOWebTemplateで確認できる

PS C:\WINDOWS\system32> Get-SPOWebTemplate

Name                     Title                                    LocaleId CompatibilityLevel
----                     -----                                    -------- ------------------
STS#3                    チーム サイト                                1041                 15
STS#0                    チーム サイト (クラシック表示)               1041                 15
BLOG#0                   ブログ                                       1041                 15
BDR#0                    ドキュメント センター                        1041                 15
DEV#0                    開発者向けサイト                             1041                 15
OFFILE#1                 レコード センター                            1041                 15
EHS#1                    チーム サイト - SharePoint Online の構成     1041                 15
BICenterSite#0           ビジネス インテリジェンス センター           1041                 15
SRCHCEN#0                エンタープライズ検索センター                 1041                 15
BLANKINTERNETCONTAINER#0 発行ポータル                                 1041                 15
ENTERWIKI#0              エンタープライズ Wiki                        1041                 15
PROJECTSITE#0            プロジェクト サイト                          1041                 15
PRODUCTCATALOG#0         製品カタログ                                 1041                 15
COMMUNITY#0              コミュニティ サイト                          1041                 15
COMMUNITYPORTAL#0        コミュニティ ポータル                        1041                 15
SITEPAGEPUBLISHING#0     コミュニケーション サイト                    1041                 15
SRCHCENTERLITE#0         基本検索センター                             1041                 15
vispr#0                  Visio プロセス リポジトリ                    1041                 15

テンプレートを用いてSharepointのサイトを作成する

PS C:\WINDOWS\system32> New-SPOSite -Url https://yusukew62.sharepoint.com/sites/blog -Owner yusuke-watanabe@yusukew62.onmicrosoft.com -StorageQuota 100 -Template BLOG#0 -LocaleId 1041
⚠️ **GitHub.com Fallback** ⚠️