<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nimble PowerShell Toolkit Certificates &amp;amp; PowerShell 6 in Application Integration</title>
    <link>https://community.hpe.com/t5/application-integration/nimble-powershell-toolkit-certificates-amp-powershell-6/m-p/7034727#M1111</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;is it possible to connect to multiple arrays at the same time ?&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Feb 2019 13:19:50 GMT</pubDate>
    <dc:creator>markshannon</dc:creator>
    <dc:date>2019-02-14T13:19:50Z</dc:date>
    <item>
      <title>Nimble PowerShell Toolkit Certificates &amp; PowerShell 6</title>
      <link>https://community.hpe.com/t5/application-integration/nimble-powershell-toolkit-certificates-amp-powershell-6/m-p/6998395#M1064</link>
      <description>&lt;P&gt;If you have used the Nimble PowerShell ToolKit (PSTK) you will likely be very familiar with the extra steps that must be taken when connecting to an array to mitigate a Nimble Self Signed Certificate. The simple command below will fail;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;PS:&amp;gt; Connect-NSGroup –Group 192.168.1.50 –Credential admin&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 5 Unable to Connect" style="width: 463px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101783iAEC7EB6CA98B0ECD/image-dimensions/463x126?v=v2" width="463" height="126" role="button" title="Certs1.gif" alt="PowerShell 5 Unable to Connect" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 5 Unable to Connect&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To make this command succeed, we need to tell PowerShell to accept untrusted certificates using the following argument;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 5 Using Ignore Option" style="width: 542px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101784i4055360651ABF23B/image-dimensions/542x52?v=v2" width="542" height="52" role="button" title="Certs2.gif" alt="PowerShell 5 Using Ignore Option" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 5 Using Ignore Option&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the simplest way to proceed, however, this may open an unacceptable risk in your environment. This is why PowerShell version 6.0.1 (available via GitHub) no longer allows this sort of bypass of certificate validation. Note: when using PowerShell 6.0.1 you must ‘CD’ to the PSTK directory to import it.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;PS:&amp;gt; CD C:\Windows\system32\WindowsPowerShell\v1.0\Modules\HPENimblePowerShellToolkit&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;PS:&amp;gt; Import-Module .\HPENimblePowerShellToolkit.psd1&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;PS:&amp;gt; Connect-NSGroup –Group 192.168.1.50 –Credential admin&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 6 Unable to Connect" style="width: 501px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101786i5BD06B94715A61D3/image-dimensions/501x159?v=v2" width="501" height="159" role="button" title="Certs3.gif" alt="PowerShell 6 Unable to Connect" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 6 Unable to Connect&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Upon trying the remediation that worked with previous versions of PowerShell, using the ‘-IgnoreServerCertificate’ option no longer works.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;PS:&amp;gt; Connect-NSGroup –Group 192.168.1.50 –Credential admin –IgnoreServerCertificate&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 6 Ignore option doesnt work" style="width: 494px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101787iB9E59691577EF83E/image-dimensions/494x142?v=v2" width="494" height="142" role="button" title="Certs4.gif" alt="PowerShell 6 Ignore option doesnt work" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 6 Ignore option doesnt work&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The solution to both of the following problems is to import the Nimble Array Certificate to the host;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Less secure communication using PowerShell 5.1 and older&lt;/LI&gt;&lt;LI&gt;No communication using PowerShell version 6.0.1 or newer&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The first step is to log onto the array via your an SSH tool such as Putty.exe (Available from Putty.org). Once you have authenticated to the array, you can use the following command to get a list of the valid certificates on the machine. Note; you can create new self-signed certifications at any time, but repeat this procedure once you have created these new certificates. Note that there are two dashes prior to the word ‘list’.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;NimbleOS $ Cert –list&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SSH Into Array to see Certs" style="width: 517px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101785i5EE9760A7C85DFEC/image-dimensions/517x169?v=v2" width="517" height="169" role="button" title="Certs5.gif" alt="SSH Into Array to see Certs" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SSH Into Array to see Certs&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you validate which certificate the API is using (which is what PowerShell Commands will also use), we want to get a text list of the certificate. You can obtain the certificate by using the following command, and copying the output to a notepad.exe on the host, then save the file to the desktop as a text file. Note as before, there are two dashes before the word ‘info’.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;NimbleOS $ cert –info group&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture the Certificate" style="width: 381px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101788i75E81A0369B07901/image-dimensions/381x355?v=v2" width="381" height="355" role="button" title="Certs6.gif" alt="Capture the Certificate" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture the Certificate&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Copy Certificate to Notepad" style="width: 383px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101790i2CFA710163BCFA2B/image-dimensions/383x406?v=v2" width="383" height="406" role="button" title="Certs7.gif" alt="Copy Certificate to Notepad" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Copy Certificate to Notepad&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Ensure that your capture continues all the way until (and includes) ‘----END CERTIFICATE----‘&lt;/P&gt;&lt;P&gt;Once you have a file on your desktop containing the text output from the ‘cert –info’ command, you will want to run the MMC control panel on windows. Open a command prompt and type “mmc” and hit enter.&lt;/P&gt;&lt;P&gt;Once the MMC is open, select ‘File’ and then ‘Add/Remove Snap-In’. You will be presented with all of the Microsoft snap-ins, choose Certificates, and select the ‘ADD’ button in the middle of the application.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MMC Add Snap-In for Certificates" style="width: 538px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101798i9A8EF60AC4079CE2/image-dimensions/538x434?v=v2" width="538" height="434" role="button" title="CertM2.gif" alt="MMC Add Snap-In for Certificates" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;MMC Add Snap-In for Certificates&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To complete the add operation, you will need to select if you want to add the certificate to the ‘user’, ‘service’, or ‘computer’ account. In this case I have chosen ‘User’.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Choose which location to place Certificates" style="width: 502px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101799i45E8519D2D043844/image-dimensions/502x282?v=v2" width="502" height="282" role="button" title="CertsW2.gif" alt="Choose which location to place Certificates" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Choose which location to place Certificates&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MMC Add SnapIn for Certificates" style="width: 489px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101789iC97B7D9CADF1D33E/image-dimensions/489x318?v=v2" width="489" height="318" role="button" title="CertsW3.gif" alt="MMC Add SnapIn for Certificates" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;MMC Add SnapIn for Certificates&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you have the MMC screen open, Open the ‘Certificates Current User’ as shown, then ‘Trusted Root Certificate Authorities’ and right click on Certificates to select all tasks, and then select ‘import’&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Certificates Import Wizard" style="width: 405px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101791i0F2CC82599B4352D/image-dimensions/405x230?v=v2" width="405" height="230" role="button" title="CertsW4.gif" alt="Certificates Import Wizard" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Certificates Import Wizard&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once the import wizard has started, it will bring up a continue screen to select next, then the following screen where you can select your previously saved certification text file.&lt;/P&gt;&lt;P&gt;Tip: When searching for the filename, ensure that you select ‘*.*’ as the extension to prevent the GUI from filtering your folder results.&lt;/P&gt;&lt;P&gt;Place the certificate in the location shown below. Do not allow the wizard to auto-select where the certificate is placed as the import will fail. Once you select the next button you should see the following warning.&lt;/P&gt;&lt;P&gt;Now that you have imported the certificate, you should see it in the list as shown below.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CerfMgrAfterAdd.gif" style="width: 477px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101797i062E6CC53EE84B55/image-dimensions/477x213?v=v2" width="477" height="213" role="button" title="CerfMgrAfterAdd.gif" alt="CerfMgrAfterAdd.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once this is complete, you can now connect to the array using the array certificate without any warnings, and without having to ignore untrusted certificates using PowerShell 5.1 (and older) and PowerShell 6.0.1 (and newer);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 5 Now Works with Certs without Ignore Option" style="width: 865px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101794i4298B2A6EA90EB25/image-size/large?v=v2&amp;amp;px=2000" role="button" title="CertsW7.gif" alt="PowerShell 5 Now Works with Certs without Ignore Option" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 5 Now Works with Certs without Ignore Option&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PowerShell 6 now works with Certs" style="width: 1141px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/101795i9C5EAD40F32F2652/image-size/large?v=v2&amp;amp;px=2000" role="button" title="CertsW8.gif" alt="PowerShell 6 now works with Certs" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PowerShell 6 now works with Certs&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;FONT size="4"&gt;&lt;U&gt;&lt;STRONG&gt;This is Nimble After All....There has GOT to be an easier way for our customers.&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;So I took a few hours yesterday to figure out how to both obtain the public key from the array as well as import the Public key to the Windows Store via PowerShell. Rest assured that I have put this in the list of enhancements that the next version of the powershell toolkit has. Until that happens, let me show you the code, and how simple it can be. The following code snippet can be used to accomplish ALL of the above tasks, all you need to do is change the IP address to the address of your array.&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;$webrequest=&lt;SPAN class="error"&gt;[net.webrequest]&lt;/SPAN&gt;::Create("&lt;A href="https://192.168.1.50:5392" target="_blank" rel="noopener"&gt;https://192.168.1.50:5392&lt;/A&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;try { $webrequest.getresponse() } catch {}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;$cert=$webrequest.servicepoint.certificate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;$bytes=$cert.export(&lt;SPAN class="error"&gt;[security.cryptography.x509certificates.x509contenttype]&lt;/SPAN&gt;::cert)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;$tfile=&lt;SPAN class="error"&gt;[system.io.path]&lt;/SPAN&gt;::getTempFileName()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;set-content -value $bytes -encoding byte -path $tfile&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;import-certificate -filepath $tfile -certStoreLocation 'Cert:\CurrentUser\Root'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&lt;SPAN&gt;import-certificate -filepath $tfile -certStoreLocation 'Cert:\localmachine\Root'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in .0001pt .5in;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 12:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/application-integration/nimble-powershell-toolkit-certificates-amp-powershell-6/m-p/6998395#M1064</guid>
      <dc:creator>Chris_Lionetti</dc:creator>
      <dc:date>2021-06-29T12:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Nimble PowerShell Toolkit Certificates &amp; PowerShell 6</title>
      <link>https://community.hpe.com/t5/application-integration/nimble-powershell-toolkit-certificates-amp-powershell-6/m-p/7034727#M1111</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;is it possible to connect to multiple arrays at the same time ?&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 13:19:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/application-integration/nimble-powershell-toolkit-certificates-amp-powershell-6/m-p/7034727#M1111</guid>
      <dc:creator>markshannon</dc:creator>
      <dc:date>2019-02-14T13:19:50Z</dc:date>
    </item>
  </channel>
</rss>

