The essentials
Quick reference
One focused task per row. Jump to the related section for complete, working examples.
| Use | Syntax | Examples |
|---|---|---|
| Inspect Storage Replica feature | Get-WindowsFeature Storage-Replica,FS-FileServer | View examples |
| Inspect disks and volumes | Get-Volume |
Select-Object DriveLetter,FileSystem,AllocationUnitSize,Size,HealthStatus | View examples |
| Run topology test | Test-SRTopology @TopologyTest | View examples |
| Open topology report | Invoke-Item 'C:\SRTest\TestSrTopologyReport.html' | View examples |
| Create partnership | New-SRPartnership @Partnership | View examples |
| Inspect replication groups | Get-SRGroup -ComputerName SR01 | View examples |
| Inspect partnerships | Get-SRPartnership -SourceComputerName SR01 | View examples |
| Read Storage Replica events | Get-WinEvent -LogName `
'Microsoft-Windows-StorageReplica/Admin' -MaxEvents `
100 | View examples |
| Read performance counters | Get-Counter '\Storage Replica Statistics(*)\Current RPO' | View examples |
| Set asynchronous mode | Set-SRPartnership -SourceComputerName SR01 -SourceRGName `
RG01 -ReplicationMode Asynchronous -WhatIf | View examples |
| Constrain replication interfaces | Set-SRNetworkConstraint @NetworkConstraint -WhatIf | View examples |
| Resize replica log | Set-SRGroup -ComputerName SR01 -Name RG01 `
-LogSizeInBytes 16GB -WhatIf | View examples |
| Permit volume resize | Set-SRGroup -ComputerName SR01 -Name RG01 `
-AllowVolumeResize $true -WhatIf | View examples |
| Reverse replication direction | Set-SRPartnership -NewSourceComputerName SR02 `
-SourceRGName RG02 -DestinationComputerName SR01 `
-DestinationRGName RG01 -WhatIf | View examples |
| Suspend a group | Suspend-SRGroup -ComputerName SR01 -Name RG01 -WhatIf | View examples |
| Remove partnership | Remove-SRPartnership -SourceComputerName SR01 `
-SourceRGName RG01 -WhatIf | View examples |
Storage Replica performs block-level volume replication between Windows Servers or clusters for disaster recovery and stretch scenarios. It is not backup: deletions, corruption, and ransomware can replicate. Production success depends on supported editions and topology, dedicated data and log volumes, sector compatibility, low-latency high-throughput networking, AD and WinRM readiness, independent backups, and rehearsed failover. Destination data volumes are normally inaccessible while replication owns them.
Step by step
Detailed examples
Verify edition, topology, storage, network, and identity
Storage Replica supports server-to-server, cluster-to-cluster, stretch cluster, and server-to-self scenarios with version-specific edition limits. Windows Server 2019 Standard is limited to one partnership, one resource group, and a single volume up to 2 TB; verify current licensing for the exact release. Servers need AD forest membership, File Server and Storage Replica features, administrative rights, WinRM, compatible sector sizes, separate data and log volumes, GPT, and adequate memory and network. Data volumes must not contain page files or system content.
Get-ComputerInfo -Property WindowsProductName,WindowsVersion,OsBuildNumber
Get-WindowsFeature Storage-Replica, FS-FileServer
Get-Disk | Select-Object Number, PartitionStyle, LogicalSectorSize, PhysicalSectorSize, HealthStatus
Get-Volume | Select-Object DriveLetter, FileSystem, AllocationUnitSize, Size, SizeRemaining
Get-NetAdapter | Where-Object Status -eq Up | Select-Object ifIndex, Name, LinkSpeed Test with representative workload before creation
Test-SRTopology checks configuration and measures throughput, latency, IOPS, and log recommendations over a chosen duration. Run long enough to cover peak workload, maintenance, and backup traffic; a short quiet test can produce unsafe sizing. It creates a temporary 100 MB test file plus report data but does not establish replication. Review every warning in the HTML report. Synchronous mode generally needs very low average round-trip latency because application writes wait for both sites.
$TopologyTest = @{
SourceComputerName='SR01'; SourceVolumeName='D:'; SourceLogVolumeName='L:'
DestinationComputerName='SR02'; DestinationVolumeName='D:'; DestinationLogVolumeName='L:'
DurationInMinutes=30; ResultPath='C:\SRTest'
}
# Generates test I/O and a report but no partnership:
# Test-SRTopology @TopologyTest
Get-ChildItem 'C:\SRTest' -ErrorAction SilentlyContinue Create replication only after backup and application quiescence
New-SRPartnership is a major mutation with no universal transaction. Source and destination data volumes must match requirements; the destination volume becomes inaccessible and its previous contents are not a safe backup. Confirm which server has authoritative data, stop or coordinate the application, take independent tested backups, verify topology report, then create during a change window. Initial block synchronization consumes substantial bandwidth and can affect latency. Feature installation or cluster changes may require restart.
Get-Volume -CimSession SR01 -DriveLetter D | Select-Object UniqueId, Size, FileSystem
Get-Volume -CimSession SR02 -DriveLetter D | Select-Object UniqueId, Size, FileSystem
$Partnership = @{
SourceComputerName='SR01'; SourceRGName='RG01'; SourceVolumeName='D:'; SourceLogVolumeName='L:'
DestinationComputerName='SR02'; DestinationRGName='RG02'; DestinationVolumeName='D:'; DestinationLogVolumeName='L:'
}
# New-SRPartnership @Partnership executes only from the approved runbook. Monitor partnership state, events, backlog, and application health
A partnership existing is not proof of current protection. Monitor source role, replication mode, last in-sync time, log utilization, health state, destination reachability, event logs, network latency, and application performance. Async Current RPO can grow during congestion; synchronous mode can stall writes during remote or network trouble. Establish alert thresholds from observed workload rather than a single generic value. Protect event forwarding because a compromised source can hide local evidence.
Get-SRGroup -ComputerName SR01 | Format-List *
Get-SRGroup -ComputerName SR02 | Format-List *
Get-SRPartnership -SourceComputerName SR01 | Format-List *
Get-WinEvent -ComputerName SR01 -LogName 'Microsoft-Windows-StorageReplica/Admin' -MaxEvents 100 |
Select-Object TimeCreated, Id, LevelDisplayName, Message Choose consistency and network paths explicitly
Synchronous replication provides zero data loss for committed writes under normal operation but adds remote latency and can affect availability. Asynchronous replication decouples acknowledgements and permits a nonzero recovery point. Changing mode changes the protection contract. Network constraints are an allowed list of interfaces and must be validated at both endpoints; misconfiguration can interrupt replication. Storage Replica uses SMB and Kerberos security capabilities, but network segmentation and least privilege remain necessary.
Get-SRPartnership -SourceComputerName SR01 |
Select-Object SourceRGName, DestinationComputerName, ReplicationMode
Get-NetIPConfiguration -CimSession SR01 | Select-Object InterfaceIndex, InterfaceAlias, IPv4Address
Get-NetIPConfiguration -CimSession SR02 | Select-Object InterfaceIndex, InterfaceAlias, IPv4Address
$NetworkConstraint = @{ SourceComputerName='SR01'; SourceRGName='RG01'; SourceNWInterface=10; DestinationComputerName='SR02'; DestinationRGName='RG02'; DestinationNWInterface=12 }
Set-SRNetworkConstraint @NetworkConstraint -WhatIf Size logs for churn, latency, and outage duration
Dedicated log volumes should use fast storage, a 64 KB allocation unit, and enough capacity for write rate and expected disconnection. Log size is not a retention history from which arbitrary old files can be restored. Resize workflows require free space and coordinated source/destination changes; shrinking or expanding replicated data volumes without documented steps can break replication. AllowVolumeResize is a temporary control, not permission to improvise. Keep independent application-consistent backups.
Get-Volume -CimSession SR01 -DriveLetter L |
Select-Object DriveLetter, FileSystem, AllocationUnitSize, Size, SizeRemaining
Get-SRGroup -ComputerName SR01 -Name RG01 |
Select-Object Name, LogVolume, LogSizeInBytes, AllowVolumeResize
Get-SRGroup -ComputerName SR02 -Name RG02 |
Select-Object Name, LogVolume, LogSizeInBytes, AllowVolumeResize Fail over the application, storage, and replication direction as one runbook
Storage Replica does not automatically move a standalone application, DNS name, IP address, service configuration, or clients in server-to-server topology. Planned direction reversal requires quiescing writes, confirming replication convergence, stopping the application at the source, changing direction, and starting the application only after validation. An unplanned disaster may lose async writes. Suspend-SRGroup dismounts the replicated volume and blocks application access until Sync-SRGroup resumes it; it is not a backup snapshot. Rehearse failback as carefully as failover.
Get-SRGroup -ComputerName SR01 -Name RG01 |
Select-Object IsPrimary, IsSuspended, ReplicationStatus, LastInSyncTime
Get-SRGroup -ComputerName SR02 -Name RG02 |
Select-Object IsPrimary, IsSuspended, ReplicationStatus, LastInSyncTime
# Stop application writes and validate backups before Set-SRPartnership direction reversal. Remove only from the current source and retain recovery evidence
Microsoft specifically warns to run Remove-SRPartnership only on the current source, not the destination. Then remove groups using the documented order after confirming application placement and backup. Removal changes protection and may make destination storage accessible; validate data ownership before anyone writes to it. WhatIf helps resolve targets but does not predict all storage/application consequences. Restrict Storage Replica administration, protect computer accounts and WinRM, and audit partnership changes.
Get-SRGroup -ComputerName SR01 | Select-Object ComputerName, Name, IsPrimary, IsInPartnership
Get-SRGroup -ComputerName SR02 | Select-Object ComputerName, Name, IsPrimary, IsInPartnership
Get-SRPartnership -SourceComputerName SR01 | Format-List *
# Remove-SRPartnership only on the verified current source in the approved retirement plan. Sources and further reading
References
Authoritative documentation used to verify and expand this cheat sheet.
- Microsoft LearnStorage Replica overviewlearn.microsoft.com
- Microsoft LearnServer-to-server storage replicationlearn.microsoft.com
- Microsoft LearnStorageReplica modulelearn.microsoft.com
- Microsoft LearnTest-SRTopologylearn.microsoft.com
- Microsoft LearnNew-SRPartnershiplearn.microsoft.com
- Microsoft LearnRemove-SRPartnershiplearn.microsoft.com
Help us improve
Found a typo or missing example?
Tell us what would make this cheat sheet clearer, more complete, or more useful.



