protected override void ProcessRecord() { RemoteConfigurationManager rcm = ConfigurationConnection.Current; rcm.MoveCollection(true, _databaseName, _collectionName, NewShard); WriteObject("Data Transfer has started. You can monitor the progress through Perfmon Counters."); }
public static void MoveCollection(ManagementInfo managementInfo) { try { RemoteConfigurationManager remoteConfigurationManager = InitializeRemoteConfigurationManager(managementInfo); remoteConfigurationManager.MoveCollection(true, managementInfo.DatabaseName, managementInfo.CollectionName, managementInfo.ShardName); } catch (ManagementException) { throw; } catch (Exception exception) { throw new ManagementException(exception.Message, exception); } }