共用方式為


Register-AzStorageSyncServer

此命令會將伺服器註冊到記憶體同步服務,以建立信任關係。 接著,PowerShell 或 Azure 入口網站 可用來設定此伺服器上的同步處理。

語法

Register-AzStorageSyncServer
        [-ResourceGroupName] <String>
        [-StorageSyncServiceName] <String>
        [-AsJob]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]
Register-AzStorageSyncServer
        [-ParentObject] <PSStorageSyncService>
        [-AsJob]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]
Register-AzStorageSyncServer
        [-ParentResourceId] <String>
        [-AsJob]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]

Description

此命令會將伺服器註冊到記憶體同步服務,這是 Azure 檔案同步 的最上層資源。系統會建立伺服器與記憶體同步服務之間的信任關係,以確保安全的數據傳輸和管理通道。 接著,PowerShell 或 Azure 入口網站 可用來設定此伺服器上的同步處理。 伺服器只能註冊到單一記憶體同步服務。 如果伺服器必須參與同步處理同一組檔案,請將它們註冊到相同的記憶體同步服務。 命令必須在要註冊的伺服器上本機執行 -- 直接執行或透過遠端 PowerShell 工作階段執行。 無法接受遠端計算機物件。

範例

範例 1

Register-AzStorageSyncServer -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "myStorageSyncServiceName"

此命令將會註冊執行此命令的本地伺服器。

參數

-AsJob

在背景執行 Cmdlet

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ParentObject

StorageSyncService 物件,通常透過 參數傳遞。

類型:PSStorageSyncService
別名:StorageSyncService
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ParentResourceId

StorageSyncService 父資源標識符

類型:String
別名:StorageSyncServiceId
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ResourceGroupName

資源群組名稱。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-StorageSyncServiceName

StorageSyncService 的名稱。

類型:String
別名:ParentName
Position:1
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

String

PSStorageSyncService

輸出

PSRegisteredServer