<?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 Oneview server discovery script with Powershell cmdlet in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/oneview-server-discovery-script-with-powershell-cmdlet/m-p/7183710#M7965</link>
    <description>&lt;P&gt;Hello Dear,&lt;/P&gt;&lt;P&gt;I'm trying to scripting multiple servers discovery (add") through the Oneview PowerShell cmdlet.&amp;nbsp; Within in script, I am using the following rest command for multiple servers add;&lt;/P&gt;&lt;P&gt;$discover = Send-OVRequest -Uri "/rest/server-hardware/discovery" -Method Post -Body $body&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;As body;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;$body = @{&lt;BR /&gt;"mpHostsAndRanges" = "[10.254.254.2 - 10.254.254.50}"&lt;BR /&gt;"username" = "hpeadmin"&lt;BR /&gt;"password" = "admin123"&lt;BR /&gt;"licensingIntent" = "OneViewStandard"&lt;BR /&gt;"configurationState" = "Monitored"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;but of course,&amp;nbsp; for the parameter "mpHostsAndRanges" , it gives me "string" instead "array."&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;$body.mpHostsAndRanges.GetType()&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;IsPublic IsSerial Name BaseType&lt;BR /&gt;-------- -------- ---- --------&lt;BR /&gt;True True &lt;STRONG&gt;String&lt;/STRONG&gt; System.Object&lt;/P&gt;&lt;P&gt;as a workaround, I can define an array with a for loop to get my IP range. ( but I do not want to prefer this method)&lt;/P&gt;&lt;P&gt;$array = @()&lt;/P&gt;&lt;P&gt;for ($i= 1 ; $i -lt 50 ; $i++) {&lt;BR /&gt;&lt;BR /&gt;$array += @("10.254.254.$i")&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;do you have any idea about this issue?&amp;nbsp; how can I define the array within the $body parameter?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Cihat&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2023 04:03:16 GMT</pubDate>
    <dc:creator>Ckirim</dc:creator>
    <dc:date>2023-03-04T04:03:16Z</dc:date>
    <item>
      <title>Oneview server discovery script with Powershell cmdlet</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-server-discovery-script-with-powershell-cmdlet/m-p/7183710#M7965</link>
      <description>&lt;P&gt;Hello Dear,&lt;/P&gt;&lt;P&gt;I'm trying to scripting multiple servers discovery (add") through the Oneview PowerShell cmdlet.&amp;nbsp; Within in script, I am using the following rest command for multiple servers add;&lt;/P&gt;&lt;P&gt;$discover = Send-OVRequest -Uri "/rest/server-hardware/discovery" -Method Post -Body $body&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;As body;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;$body = @{&lt;BR /&gt;"mpHostsAndRanges" = "[10.254.254.2 - 10.254.254.50}"&lt;BR /&gt;"username" = "hpeadmin"&lt;BR /&gt;"password" = "admin123"&lt;BR /&gt;"licensingIntent" = "OneViewStandard"&lt;BR /&gt;"configurationState" = "Monitored"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;but of course,&amp;nbsp; for the parameter "mpHostsAndRanges" , it gives me "string" instead "array."&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;$body.mpHostsAndRanges.GetType()&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;IsPublic IsSerial Name BaseType&lt;BR /&gt;-------- -------- ---- --------&lt;BR /&gt;True True &lt;STRONG&gt;String&lt;/STRONG&gt; System.Object&lt;/P&gt;&lt;P&gt;as a workaround, I can define an array with a for loop to get my IP range. ( but I do not want to prefer this method)&lt;/P&gt;&lt;P&gt;$array = @()&lt;/P&gt;&lt;P&gt;for ($i= 1 ; $i -lt 50 ; $i++) {&lt;BR /&gt;&lt;BR /&gt;$array += @("10.254.254.$i")&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;do you have any idea about this issue?&amp;nbsp; how can I define the array within the $body parameter?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Cihat&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 04:03:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-server-discovery-script-with-powershell-cmdlet/m-p/7183710#M7965</guid>
      <dc:creator>Ckirim</dc:creator>
      <dc:date>2023-03-04T04:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Oneview server discovery script with Powershell cmdlet</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-server-discovery-script-with-powershell-cmdlet/m-p/7184002#M7981</link>
      <description>&lt;P style="margin: 0;"&gt;Hello&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;Please check the below link if that helps you.&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;Link : &lt;A href="https://github.com/HewlettPackard/POSH-HPEOneView/issues/438" target="_blank"&gt;https://github.com/HewlettPackard/POSH-HPEOneView/issues/438&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;Cheers...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 09:18:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-server-discovery-script-with-powershell-cmdlet/m-p/7184002#M7981</guid>
      <dc:creator>MV3</dc:creator>
      <dc:date>2023-03-03T09:18:34Z</dc:date>
    </item>
  </channel>
</rss>

