Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect-ManagementServer: first connection fails #66

Closed
Silex opened this issue Aug 9, 2022 · 3 comments
Closed

Connect-ManagementServer: first connection fails #66

Silex opened this issue Aug 9, 2022 · 3 comments

Comments

@Silex
Copy link
Contributor

Silex commented Aug 9, 2022

Hello,

With 22.0.0 the first time I connect to a server it usually fails:

PS C:\Users\ext-adm-pva> Import-Module -Verbose -Name 'MilestonePSTools'
VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\MilestonePSTools.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7 because it is not included in the list of permitted
versions.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.0 because it is not included in the list of permitted
versions.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\MIPSDKRedist\22.2.0\MipSdkRedist.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\MipSdkRedist\22.2.0\MipSdkRedist.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.0 because it is not included in the list of permitted
versions.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\MipSdkRedist\22.2.0\MipSdkRedist.psm1'.
VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\MipSdkRedist\22.2.0\Bin\MipSdkRedist.dll'.
VERBOSE: Exporting variable 'MipSdkPath'.
VERBOSE: Importing variable 'MipSdkPath'.
VERBOSE: Loading 'Assembly' from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\System.Drawing'.
VERBOSE: Loading 'Assembly' from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\System.Drawing'.
VERBOSE: Loading 'Assembly' from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\System.Device'.
VERBOSE: Loading 'Assembly' from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\System.Device'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\MilestonePSTools.Format.ps1xml'.

### WAITING 20 SECONDS HERE

VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\MilestonePSTools.psm1'.
VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\MilestonePSTools\22.2.0\bin\MilestonePSTools.dll'.
VERBOSE: Importing cmdlet 'Get-VideoSource'.
VERBOSE: Importing cmdlet 'Get-Snapshot'.

(skipping) 

VERBOSE: Importing alias 'Get-ManagementServer'.

PS C:\Users\ext-adm-pva> Connect-ManagementServer -Verbose -Server $server
VERBOSE: Disconnecting from current site and any child sites if present.
### WAITING 20 SECONDS HERE
Connect-ManagementServer :
At line:1 char:1
+ Connect-ManagementServer -Verbose -Server $server
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : AuthenticationError: (:) [Connect-ManagementServer], ServerNotFoundMIPException
    + FullyQualifiedErrorId : MilestonePSTools.ConnectionCommands.ConnectManagementServer

PS C:\Users\ext-adm-pva> Connect-ManagementServer -Verbose -Server $server
PS C:\Users\ext-adm-pva>

As you see two times I'm just waiting 20 seconds for something to happen (when loading the module and when connecting the first time).

This behavior never happened with 21.2.7.

Is there some debug flag I can turn on?

I'm connecting to 2021R2 servers.

@Silex
Copy link
Contributor Author

Silex commented Aug 9, 2022

In the meantime I'm working around it like this:

function Connect-ManagementServer {
  param([Parameter(Mandatory=$true)][string] $Server)
  foreach($try in 1..3) {
    try {
      MilestonePSTools\Connect-ManagementServer -Server $Server -ErrorAction Stop
      break
    }
    catch {
      if ($try -eq 3) {
        Write-Error $_
      }
    }
  }
}

@joshooaj
Copy link
Collaborator

That's really weird - do you still have this issue? The -Server parameter is deprecated and -ServerAddress may or may not work better.

@Silex
Copy link
Contributor Author

Silex commented Dec 7, 2022

Yes it still happens with the new version, with or without -ServerAddress... my guess is that this client's network is shaky, forget about it.

@Silex Silex closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants