coexistence-configuration の PSsnap-in を追加すると何ができるようになるのか
PowerShell から手動で Office 365 とディレクトリ同期を行うときに Add-PSsnapin coexistence-configuration
を実行してから Start-OnlineCoexistenceSync
を実行するというのは検索すればすぐに出てくるので新しい話ではないのですが、ちょっと待て、と。よく考えてみると Start-OnlineCoexistenceSync
だけを実行するために PSsnap-in を落としてくるのはちょっと非効率すぎないかと思って、中身を見てみました。
Get-Command -Module Coexistence-Configuration | ft CommandType,Name -AutoSize CommandType Name ----------- ---- Cmdlet Disable-DirSyncLog Cmdlet Disable-MSOnlinePasswordSync Cmdlet Disable-MSOnlineRichCoexistence Cmdlet Disable-PasswordSyncLog Cmdlet Enable-DirSyncLog Cmdlet Enable-MSOnlinePasswordSync Cmdlet Enable-MSOnlineRichCoexistence Cmdlet Enable-PasswordSyncLog Cmdlet Get-CoexistenceConfiguration Cmdlet Get-DirSyncLogStatus Cmdlet Get-PasswordSyncLogStatus Cmdlet Set-CoexistenceConfiguration Cmdlet Set-CompanyDirSyncFeatures Cmdlet Set-FullPasswordSync Cmdlet Start-OnlineCoexistenceSync Cmdlet Update-MSOLDirSyncNetworkProxySetting
他にもたくさんありますねw
上で列挙されたコマンドの名前を見るとだいたい何をするためのコマンドかわかりますが、coexistence-configuration
スナップインを追加することで Windows Azure Active Directory ディレクトリ同期ツールの構成ウィザードで設定する内容を PowerShell で実行するための(本当はツールが裏で PS を実行しているだけだと思いますが)コマンド各種が実行可能になるようです。詳細は後述で Get-Help -Detailed
した内容を貼付けておくので興味があれば見てみてください(ところでこれらのコマンドがなぜ公式で一切情報提供されてないんでしょうか…)。
Enable-MSOnlineRichCoexistence
って何かと思ったのですがおそらく構成ウィザードにおける [混合環境を有効にする] で、Azure -> On-Premise の方向での同期の権限付与とかそういう動作のためのコマンドみたいです。
あと、Update-MSOLDirSyncNetworkProxySetting
は Error message when you run the Directory Sync tool Configuration Wizard: "Your credentials could not be authenticated" という KB が出ていることから察するに、構成ウィザードでは WinHTTP のプロキシの設定を拾ってくれる一方 PowerShell の場合は明示的にこのコマンドでプロキシの設定を拾わないとだめな感じでしょうか。
名前 Disable-DirSyncLog 概要 This commandlet is used to disable logging for the Azure Active Directory Sync tool. 構文 Disable-DirSyncLog [<CommonParameters>] 説明 This commandlet is used to disable logging for the Azure Active Directory Sync tool. パラメーター <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Disable-DirSyncLog 注釈 例を参照するには、次のように入力してください: "get-help Disable-DirSyncLog -examples". 詳細を参照するには、次のように入力してください: "get-help Disable-DirSyncLog -detailed". 技術情報を参照するには、次のように入力してください: "get-help Disable-DirSyncLog -full". 名前 Disable-MSOnlinePasswordSync 構文 Disable-MSOnlinePasswordSync -Credential <pscredential> [-WhatIf] [-Confirm] [<CommonParameters>] パラメーター -Confirm -Credential <pscredential> -WhatIf <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 エイリアス なし 注釈 なし 名前 Disable-MSOnlineRichCoexistence 構文 Disable-MSOnlineRichCoexistence -Credential <pscredential> [-WhatIf] [-Confirm] [<CommonParameters>] パラメーター -Confirm -Credential <pscredential> -WhatIf <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 エイリアス なし 注釈 なし 名前 Disable-PasswordSyncLog 概要 This commandlet is used to disable logging for the Password Sync feature of the Azure Active Directory Sync tool. 構文 Disable-PasswordSyncLog [<CommonParameters>] 説明 This commandlet is used to disable logging for the Password Sync feature of the Azure Active Directory Sync tool. パラメーター <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Disable-PasswordSyncLog 注釈 例を参照するには、次のように入力してください: "get-help Disable-PasswordSyncLog -examples". 詳細を参照するには、次のように入力してください: "get-help Disable-PasswordSyncLog -detailed". 技術情報を参照するには、次のように入力してください: "get-help Disable-PasswordSyncLog -full". 名前 Enable-DirSyncLog 概要 This commandlet is used to configure the logging level for the Azure Active Directory Sync tool. 構文 Enable-DirSyncLog [-FilePath <String>] [-TraceLevel <String>] [<CommonParameters>] 説明 This commandlet is used to configure the logging level for the Azure Active Directory Sync tool. パラメーター -FilePath <String> Specifies the location in the files system where the log file should be written to. If not speci fied, defaults to the location where the Directory Sync tool is installed. -TraceLevel <String> Specifies the level to configure the Directory Sync tool to log at. Valid options are: “Error”, “Warning”, “Info”, “Verbose”. If not specified, defaults to “Verbose”. <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Enable-DirSyncLog -TraceLevel Info -FilePath C:\DirSync.log 注釈 例を参照するには、次のように入力してください: "get-help Enable-DirSyncLog -examples". 詳細を参照するには、次のように入力してください: "get-help Enable-DirSyncLog -detailed". 技術情報を参照するには、次のように入力してください: "get-help Enable-DirSyncLog -full". 名前 Enable-MSOnlinePasswordSync 構文 Enable-MSOnlinePasswordSync -Credential <pscredential> [-WhatIf] [-Confirm] [<CommonParameters>] パラメーター -Confirm -Credential <pscredential> -WhatIf <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 エイリアス なし 注釈 なし 名前 Enable-MSOnlineRichCoexistence 構文 Enable-MSOnlineRichCoexistence -Credential <pscredential> [-WhatIf] [-Confirm] [<CommonParameters>] パラメーター -Confirm -Credential <pscredential> -WhatIf <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 エイリアス なし 注釈 なし 名前 Enable-PasswordSyncLog 概要 This commandlet is used to configure the logging level for the Password Sync feature of the Azure Active Directory Sync tool. 構文 Enable-PasswordSyncLog [-FilePath <String>] [-TraceLevel <String>] [<CommonParameters>] 説明 This commandlet is used to configure the logging level for the Password Sync feature of the Azure Active Directory Sync tool. パラメーター -FilePath <String> Specifies the location in the files system where the log file should be written to. If not speci fied, defaults to the location where the Directory Sync tool is installed. -TraceLevel <String> Specifies the level to configure the Directory Sync tool to log at. Valid options are: “Error”, “Warning”, “Info”, “Verbose”. If not specified, defaults to 'Verbose'. <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Enable-PasswordSyncLog -TraceLevel Info -FilePath C:\PasswordSync.log 注釈 例を参照するには、次のように入力してください: "get-help Enable-PasswordSyncLog -examples". 詳細を参照するには、次のように入力してください: "get-help Enable-PasswordSyncLog -detailed". 技術情報を参照するには、次のように入力してください: "get-help Enable-PasswordSyncLog -full". 名前 Get-CoexistenceConfiguration 概要 Gets a configuration information from the Microsoft Online Coexistence Web Server 構文 Get-CoexistenceConfiguration -TargetCredentials <PSCredential> [<CommonParameters>] 説明 Gets a configuration information from the Microsoft Online Coexistence Web Server パラメーター -TargetCredentials <PSCredential> Administrative credentials for a company in Microsoft Online. <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Get Configuration -------------- C:\PS>$cnfg = Get-CoexistenceConfiguration Gets a configuration object from the Microsoft Online Web Service 注釈 例を参照するには、次のように入力してください: "get-help Get-CoexistenceConfiguration -examples". 詳細を参照するには、次のように入力してください: "get-help Get-CoexistenceConfiguration -detailed". 技術情報を参照するには、次のように入力してください: "get-help Get-CoexistenceConfiguration -full". 名前 Get-DirSyncLogStatus 概要 This commandlet is used to retrieve the current logging level for the Azure Active Directory Sync tool. 構文 Get-DirSyncLogStatus [<CommonParameters>] 説明 This commandlet is used to retrieve the current logging level for the Azure Active Directory Sync tool. パラメーター <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Get-DirSyncLogStatus 注釈 例を参照するには、次のように入力してください: "get-help Get-DirSyncLogStatus -examples". 詳細を参照するには、次のように入力してください: "get-help Get-DirSyncLogStatus -detailed". 技術情報を参照するには、次のように入力してください: "get-help Get-DirSyncLogStatus -full". 名前 Get-PasswordSyncLogStatus 概要 This commandlet is used to retrieve the current logging level for the Password Sync feature of the Azure Active Directory Sync tool. 構文 Get-PasswordSyncLogStatus [<CommonParameters>] 説明 This commandlet is used to retrieve the current logging level for the Password Sync feature of the Azure Active Directory Sync tool. パラメーター <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Example -------------- C:\PS>Get-PasswordSyncLogStatus 注釈 例を参照するには、次のように入力してください: "get-help Get-PasswordSyncLogStatus -examples". 詳細を参照するには、次のように入力してください: "get-help Get-PasswordSyncLogStatus -detailed". 技術情報を参照するには、次のように入力してください: "get-help Get-PasswordSyncLogStatus -full". 名前 Set-CoexistenceConfiguration 概要 Configures Microsoft Online Directory Synchronization Tool. 構文 Set-CoexistenceConfiguration -SourceCredentials <PSCredential> -TargetCredentials <PSCredential> [-Config] <CoexistenceConfiguration> [-Path <String>] [-WhatIf] [-Confirm] [<CommonParameters>] 説明 Configures Microsoft Online Directory Synchronization Tool. パラメーター -SourceCredentials <PSCredential> Enterprise Admin credentials for the forest that will be sent up to Microsoft Online. These credentials are used to create an account in Active Directory that has the minimum required permissions to read from Active Directory. -TargetCredentials <PSCredential> Administrative credentials for a company in Microsoft Online. -Config <CoexistenceConfiguration> Configuration object returned from Get-CoexistenceConfiguration -Path <String> The directory which contains XML that defines the default management agents and the metaverse schema. -WhatIf -Confirm <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Configuration -------------- C:\PS>$cnfg = Get-CoexistenceConfiguration Set-CoexistenceConfiguration $cnfg Configures Microsoft Online Directory Synchronization. 注釈 例を参照するには、次のように入力してください: "get-help Set-CoexistenceConfiguration -examples". 詳細を参照するには、次のように入力してください: "get-help Set-CoexistenceConfiguration -detailed". 技術情報を参照するには、次のように入力してください: "get-help Set-CoexistenceConfiguration -full". 名前 Set-CompanyDirSyncFeatures 構文 Set-CompanyDirSyncFeatures -TargetCredentials <pscredential> -FeaturesFlag <int> [<CommonParameters> ] パラメーター -FeaturesFlag <int> -TargetCredentials <pscredential> <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 エイリアス なし 注釈 なし 名前 Set-FullPasswordSync 概要 Resets the password sync state information forcing a full sync the next time the service is restarted. 構文 Set-FullPasswordSync [<CommonParameters>] 説明 Resets the password sync state information forcing a full sync the next time the service is restarted. パラメーター <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Set FullPasswordSync -------------- C:\PS>Set-FullPasswordSync Resets the password sync state information forcing a full sync the next time the service is restarted. 注釈 例を参照するには、次のように入力してください: "get-help Set-FullPasswordSync -examples". 詳細を参照するには、次のように入力してください: "get-help Set-FullPasswordSync -detailed". 技術情報を参照するには、次のように入力してください: "get-help Set-FullPasswordSync -full". 名前 Start-OnlineCoexistenceSync 概要 Starts synchronization with Microsoft Online 構文 Start-OnlineCoexistenceSync [-FullSync] [-WhatIf] [-Confirm] [<CommonParameters>] 説明 Starts synchronization with Microsoft Online パラメーター -FullSync Performs a full sync with Microsoft Online. -WhatIf -Confirm <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- Start Sync -------------- C:\PS>Start-OnlineCoexistenceSync Starts a directory sync with Microsoft Online. ----------- Start Full Sync ------------ C:\PS>Start-OnlineCoexistenceSync -FullSync Performs a full sync with Microsoft Online. 注釈 例を参照するには、次のように入力してください: "get-help Start-OnlineCoexistenceSync -examples". 詳細を参照するには、次のように入力してください: "get-help Start-OnlineCoexistenceSync -detailed". 技術情報を参照するには、次のように入力してください: "get-help Start-OnlineCoexistenceSync -full". 名前 Update-MSOLDirSyncNetworkProxySetting 概要 Updates the directory sync service to use the current user's http proxy settings. 構文 Update-MSOLDirSyncNetworkProxySetting [[-NoProxyUpdate]] [-WhatIf] [-Confirm] [<CommonParameters>] 説明 Copies the current user's http proxy settings off to a .config file. The directory sync will apply these settings each time it communicates with the directory sync web service パラメーター -NoProxyUpdate Causes directory sync to ignore the http proxy settings that were saved in a .config file. -WhatIf -Confirm <CommonParameters> このコマンドレットは、次の共通パラメーターをサポートします: Verbose、 Debug、ErrorAction、ErrorVariable、WarningAction、WarningVariable、 OutBuffer、および OutVariable。詳細については、about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216) を参照してください。 -------------- EXAMPLE 1 -------------- C:\PS>Update-MSOLDirSyncNetworkProxySetting Updates the http proxy settings that directory sync will use -------------- EXAMPLE 2 -------------- C:\PS>Update-MSOLDirSyncNetworkProxySetting -NoProxyUpdate Disables the automatic application of current user setting to the directory sync service. 注釈 例を参照するには、次のように入力してください: "get-help Update-MSOLDirSyncNetworkProxySetting -examples". 詳細を参照するには、次のように入力してください: "get-help Update-MSOLDirSyncNetworkProxySetting -detailed". 技術情報を参照するには、次のように入力してください: "get-help Update-MSOLDirSyncNetworkProxySetting -full". オンライン ヘルプを参照するには、次のように入力してください: "get-help Update-MSOLDirSyncNetworkProxySetting -online"