locked
Deregister a Registered Server RRS feed

  • Question

  • Hi

    I set up a free account to test the File Sync capability and am looking to deploy this now.  In doing so i wanted to create a new storage sync service and remove the testing services I'd set up.  So i deregistered the servers and deleted the sync service and associated file storage and created a new file store and sync service.

    One of the servers re-registered fine, but the other one keeps giving me a message to say its already registered.  I cannot fine where it is registered to de-register it.  

    Any help would be appreciated.

    Thanks

    Matthew

    Monday, January 28, 2019 2:30 PM

Answers

  • Matthew,

    If the Storage Sync Service no longer exists, run the following PowerShell commands on the server to reset the registration state:

    Import-Module"C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"

    Reset-StorageSyncServer

    Once you run the PowerShell commands, run ServerRegistration.exe to re-register the servers (the default location is C:\Program Files\Azure\StorageSyncAgent).

     

    Thanks,


    Jeff

    Monday, January 28, 2019 4:41 PM

All replies

  • Hello Matthew,

    Remove the server from all sync groups

    Before unregistering the server on the Storage Sync Service, all server endpoints on that server must be removed. This can be done via the Azure portal:

    1. Navigate to the Storage Sync Service where your server is registered.
    2. Remove all server endpoints for this server in each sync group in the Storage Sync Service. This can be accomplished by right-clicking the relevant server endpoint in the sync group pane.

    Do it with PS as follows

    Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.PowerShell.Cmdlets.dll"
    
    $accountInfo = Connect-AzAccount
    Login-AzStorageSync -SubscriptionId $accountInfo.Context.Subscription.Id -TenantId $accountInfo.Context.Tenant.Id -ResourceGroupName "<your-resource-group>"
    
    $StorageSyncService = "<your-storage-sync-service>"
    
    Get-AzureRmStorageSyncGroup -StorageSyncServiceName $StorageSyncService | ForEach-Object { 
        $SyncGroup = $_; 
        Get-AzureRmStorageSyncServerEndpoint -StorageSyncServiceName $StorageSyncService -SyncGroupName $SyncGroup.Name | Where-Object { $_.DisplayName -eq $env:ComputerName } | ForEach-Object { 
            Remove-AzureRmStorageSyncServerEndpoint -StorageSyncServiceName $StorageSyncService -SyncGroupName $SyncGroup.Name -ServerEndpointName $_.Name 
        } 
    }

    Unregister the server

    Now that all data has been recalled and the server has been removed from all sync groups, the server can be unregistered.

    1. In the Azure portal, navigate to the Registered servers section of the Storage Sync Service.
    2. Right-click on the server you want to unregister and click "Unregister Server".


    Regards From: Exchange Online | www.cloudcompute.info


    • Edited by ManU PhiliP Monday, January 28, 2019 2:46 PM change signature
    Monday, January 28, 2019 2:39 PM
  • Hi

    Thanks for the reply - the storage sync service is already deleted and the only one i have visible does not contain the server i wish to de-register.

    Will the PS Script above still de-register the server?

    Monday, January 28, 2019 3:49 PM
  • Matthew,

    If the Storage Sync Service no longer exists, run the following PowerShell commands on the server to reset the registration state:

    Import-Module"C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"

    Reset-StorageSyncServer

    Once you run the PowerShell commands, run ServerRegistration.exe to re-register the servers (the default location is C:\Program Files\Azure\StorageSyncAgent).

     

    Thanks,


    Jeff

    Monday, January 28, 2019 4:41 PM
  • Perfect - Thanks! :)
    Monday, January 28, 2019 5:51 PM