This just bit me, it had been working great for well over a year and now no matter what computer we run it on anywhere in the domain we get the following error:
Exception calling "GetServers" with "1" argument(s): "The format of the specified domain name is invalid"
At C:\Users\<myuser>\Documents\WindowsPowerShell\Modules\psterminalservices\PSTerminalServices.psm1:1376 char:3
- CategoryInfo : NotSpecified: (:) , ParentContainsErrorRecordException
- FullyQualifiedErrorId : Win32Exception
I have tried to specify both computername and domainname as part of my command line:
Get-TSServers -DomainName MyDomain.Local
Stepping through the function inside of a debugger, I've found the trouble is where/when it gets to the following:
$TSManager = New-Object Cassia.TerminalServicesManager
In this instance, I've verified $Domainname is a string containing the simple NetBios name of my domain. Still, upon execution it throws the aforementioned error.
Like I said, this seems to have hit us all at once. The Get-TSSession commandlet still works, it's only the Get-TSServers comandlet that doesn't.
Many thanks for any suggestions or advice.