Array Setup and Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Connect-NSGroup does not connect me

david_reese
Occasional Advisor

Connect-NSGroup does not connect me

Using NimbleOS 3.5.2.0-400159-opt and Powershell version 4.0, when I run "Connect-nsgroup", it does not connect me. Output of command:


PS C:\Users\david.reese> Connect-NSGroup -group <Management IP>



cmdlet Connect-NSGroup at command pipeline position 1


Supply values for the following parameters:


credential


Get-Certificate : Failed to get website certificate. The error was 'Exception calling "GetResponse" with "0"


argument(s): "Unable to connect to the remote server"'.


At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\NimblePowerShellToolKit\NimblePowerShellToolKit.psm1:867 char:13


+     $cert = Get-Certificate -Uri $url -TrustAllCertificates


+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException


    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-Certificate



Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"


Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"


At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\NimblePowerShellToolKit\NimblePowerShellToolKit.psm1:839 char:9


+         $response = $webClient.DownloadString($url) | ConvertFrom-Json


+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException


    + FullyQualifiedErrorId : WebException



PS C:\Users\david.reese>






12 REPLIES
mblumberg16
Respected Contributor

Re: Connect-NSGroup does not connect me

Hi,

I've tested it in my lab, and I can't see the same issue, did you add the -Credential value?

Also did you set the ExecutionPolicy to unrestricted?

Screen Shot 2017-01-04 at 12.24.07.png

PS C:\> Get-Host

Name             : ConsoleHost

Version          : 4.0

InstanceId       : 137c5d62-d525-4e6d-bc5e-b52c00727fe2

UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface

CurrentCulture   : en-GB

CurrentUICulture : en-US

PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy

IsRunspacePushed : False

Runspace         : System.Management.Automation.Runspaces.LocalRunspace

PS C:\> $mycredentials = Get-Credential

cmdlet Get-Credential at command pipeline position 1

Supply values for the following parameters:

Credential

PS C:\> Connect-NsGroup -Group 10.66.32.23 -Credentia $mycredentials

Group        : TS-EMEA-02

ManagementIP : 10.66.32.23

User         : admin

Model        : CS260

SerialNo     : AA-102801

Version      : 3.6.0.0-414301-opt

PS C:\> Get-ExecutionPolicy

Unrestricted

PS C:\>

Thanks!

Moshe

david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

Thank you for the reply!

It appears that my workstation may not have the network access to connect to the array via powershell. I'm using another machine now that does have access and am getting a new error about "Lack of Resources":

PS C:\Windows\system32> Connect-NSGroup -group <MGMNT IP>

cmdlet Connect-NSGroup at command pipeline position 1

Supply values for the following parameters:

credential

Testing connection to computer <MGMNT IP> failed: Error due to lack of resources

Test-Connection : Testing connection to computer <MGMNT IP> failed: Error due to lack of resources

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\NimblePowerShellToolkit\NimblePowerShellToolKit.psm1:859 char:9

+         Test-Connection -ComputerName $group -Count 3 -ErrorAction Stop | Out-Nu ...

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (<MGMNT IP>:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

PS C:\Windows\system32>

mblumberg16
Respected Contributor

Re: Connect-NSGroup does not connect me

Are you able to ssh to the IP address at all? make sure you're using the IP of the mgmt and not the controller.

david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

Yes, i am able to SSH to the arrays mgmnt IP which is the same one im suing for SSH, Webui and also the powershell cmdlets.

mblumberg16
Respected Contributor

Re: Re: Connect-NSGroup does not connect me

can you test the connection? change IP to yours.

PS C:\> Test-Connection 10.66.32.23 -count 1

Source        Destination    IPV4Address      IPV6Address                              Bytes    Time(ms)

------        -----------    -----------      -----------                              -----    --------

WIN-BSOOVT... 10.66.32.23                                                              32      299

the lack of resource is an indication the host can't reach the target:

PS C:\> Test-Connection 10.66.38.23 -count 1

Test-Connection : Testing connection to computer '10.66.38.23' failed: Error due to lack of resources

At line:1 char:1

+ Test-Connection 10.66.38.23 -count 1

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (10.66.38.23:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

PS C:\>

david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

Does it ping the target first? is there a way to suppress the ping and just try connecting?

PS C:\Users\dreesesu> Test-Connection <MGMNTIP>

Test-Connection : Testing connection to computer '<MGMNTIP>' failed: Error due to lack of resources

At line:1 char:1

+ Test-Connection <MGMNTIP>

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (<MGMNTIP>:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

Test-Connection : Testing connection to computer '<MGMNTIP>' failed: Error due to lack of resources

At line:1 char:1

+ Test-Connection <MGMNTIP>

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (<MGMNTIP>:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

Test-Connection : Testing connection to computer '<MGMNTIP>' failed: Error due to lack of resources

At line:1 char:1

+ Test-Connection <MGMNTIP>

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (<MGMNTIP>:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

Test-Connection : Testing connection to computer '<MGMNTIP>' failed: Error due to lack of resources

At line:1 char:1

+ Test-Connection <MGMNTIP>

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (<MGMNTIP>:String) [Test-Connection], PingException

    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

PS C:\Users\dreesesu>

mblumberg16
Respected Contributor

Re: Connect-NSGroup does not connect me

yes the line of code is :

    try {

        Test-Connection -ComputerName $group -Count 3 -ErrorAction Stop | Out-Null

    } catch [system.net.NetworkInformation.PingException] {

        PrintError $_ "Unable to Reach Group $group"

the test connection is a ping test,  do you have firewall issues? with ICMP ?

david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

Yes, we dont allow ping many places. If this is truly needed, i can open it up in order to let the connection finish.

mblumberg16
Respected Contributor

Re: Connect-NSGroup does not connect me

as an unsupported configurations you can try and remove the test-connection part from the connect function:

on the extracted folder of the Nimble Powershell you will find a file "NimblePowerShellToolKit.psm1", try removing lines 858 to 865, this will skip the try of the test-connection.

Here are the lines to remove:

try {

        Test-Connection -ComputerName $group -Count 3 -ErrorAction Stop | Out-Null

    } catch [system.net.NetworkInformation.PingException] {

        PrintError $_ "Unable to Reach Group $group"

    } catch {

        PrintError $_ "Unknow error occured while pinging $group"

    }

You might have to import the modules again with:

import-module NimblePowerShellToolkit

Let me know if it works, but please understand that it's not supported.

david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

understanding that it is unsupported and if no further help is allowed but im getting that cert error that i was getting before and also a couldnt connect to resource.Do you know what ports powershell uses to communicate with the array? I could put a wireshark on it or look at firewall logs if need be.

PS C:\Windows\system32> connect-nsgroup -group <MGMNTIP>

cmdlet Connect-NSGroup at command pipeline position 1

Supply values for the following parameters:

credential

Get-Certificate : Failed to get website certificate. The error was 'Exception calling "GetResponse" with "0"

argument(s): "Unable to connect to the remote server"'.

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\NimblePowerShellToolKit\NimblePowerShellToolKit.psm1:867 char:13

+     $cert = Get-Certificate -Uri $url -TrustAllCertificates

+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-Certificate

Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"

Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\NimblePowerShellToolKit\NimblePowerShellToolKit.psm1:839 char:9

+         $response = $webClient.DownloadString($url) | ConvertFrom-Json

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : WebException

PS C:\Windows\system32>

mblumberg16
Respected Contributor

Re: Connect-NSGroup does not connect me

Looking online it seems that HTTP port 5985,  and HTTPS  port 5986.

As for the certificate error, looking at some internal notes it could be related to proxy settings, do you have one in house?      

Highlighted
david_reese
Occasional Advisor

Re: Connect-NSGroup does not connect me

We do not have a proxy set on this machine. I will try to look for firewall blocks on those two ports while trying to access the array.