Forum Discussion
Test-SRTopology fails with an error message using PowertShell
I have the same issue crated a test lab, where I have 2 servers both are DCs, well connected. After I finished configuring Storage Replica I run the command Test-SRTopology and I get an error.
below is the first error when I use the name of both servers:
PS C:\Users\Administrator> Test-SRTopology -SourceComputerName NYC-DC1 -SourceVolumeName R: -SourceLogVolumeName L: -DestinationComputerName NYC-SVR1.ABC.com -DestinationVolumeName R: -DestinationLogVolumeName L: -DurationInMinutes 5 -ResultPath C:\results\
WARNING: WMI v2.0 could not create a CIM Session for NYC-DC1 Possible reasons are:
You specified an incorrect NetBIOS name or fully qualified domain name for the destination computer
You specified an IP address for the destination server. Only NetBIOS names or fully qualified domain names are allowed
The destination computer firewall is blocking access to PowerShell or WMI remoting
You are logged on to the source computer as a local user. You must use a domain user
You did not use CREDSSP credentials when running the Test-SRTopology cmdlet remotely from a management computer
The destination computer is not running or is not accessible over the network
The destination computer is not running the WMI service
WARNING: System.Exception
WARNING: at Microsoft.FileServices.SR.Powershell.MIConnection.GetNamespace(String namespaceName, String computerName)
at Microsoft.FileServices.SR.Powershell.TestSRTopologyCommand.GetNetBiosName(String ComputerName)
at Microsoft.FileServices.SR.Powershell.TestSRTopologyCommand.BeginProcessing()
Test-SRTopology : WMI v2.0 could not create a CIM Session for NYC-DC1
Possible reasons are:
You specified an incorrect NetBIOS name or fully qualified domain name for the destination computer
You specified an IP address for the destination server. Only NetBIOS names or fully qualified domain names are allowed
The destination computer firewall is blocking access to PowerShell or WMI remoting
You are logged on to the source computer as a local user. You must use a domain user
You did not use CREDSSP credentials when running the Test-SRTopology cmdlet remotely from a management computer
The destination computer is not running or is not accessible over the network
The destination computer is not running the WMI service
At line:1 char:1
+ Test-SRTopology -SourceComputerName NYC-DC1 -SourceVolumeName R: -Sou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Test-SRTopology], Exception
+ FullyQualifiedErrorId : TestSRTopologyFailure,Microsoft.FileServices.SR.Powershell.TestSRTopologyCommand
The second error when I use fully qualified name of both servers:
PS C:\Users\Administrator> Test-SRTopology -SourceComputerName NYC-DC01.ABC.com -SourceVolumeName R: -SourceLogVolumeName L: -DestinationComputerName NYC-SVR1.ABC.com -DestinationVolumeName R: -DestinationLogVolumeName L: -DurationInMinutes 5 -ResultPath C:\results\
WARNING: Specified cast is not valid.
WARNING: System.InvalidCastException
WARNING: at Microsoft.FileServices.SR.Powershell.MSFTVolume.get_FileSystemType()
at Microsoft.FileServices.SR.Powershell.Volume.GetVolume(String Path, String ComputerName)
at Microsoft.FileServices.SR.Powershell.TestSRTopologyCommand.BeginProcessing()
Test-SRTopology : Specified cast is not valid.
At line:1 char:1
+ Test-SRTopology -SourceComputerName NYC-DC01.ABC.com -SourceVolumeNam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Test-SRTopology], InvalidCastException
+ FullyQualifiedErrorId : TestSRTopologyFailure,Microsoft.FileServices.SR.Powershell.TestSRTopologyCommand
The script I ran (subset shown abovce) has worked in the past. But now it doesn;t work in PowerSHell7 or Windows PowerShell.
I have filed a feedback item but since I suspect with so few folsk have hit this issue, this issue hasn';t risen to a level where investigation is undertaken.
I had planned to use this cmdlet in my lstest book on PowerShell and Windows Server 2022. But as it fails, I removed it. and described this cmdlet as non-functioning.
Like so many, many places, Microsoft seem to have abandoned Windows Server on Prem in their push to the cloud. There are many minor places where IT Pros could benefit frtom some improvements (like enabling ther BPA, WSUS, cmdlets to run in PowerShell 7).
I just gave up on a fix and have moved on,. From my testing, even though this cmdlet fails, the SR partnership works a treat. A great feature!