- Community Home
- >
- Software
- >
- HPE OneView
- >
- Oneview server discovery script with Powershell cm...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 01:18 AM - last edited on 03-03-2023 08:03 PM by support_s
02-28-2023 01:18 AM - last edited on 03-03-2023 08:03 PM by support_s
Oneview server discovery script with Powershell cmdlet
Hello Dear,
I'm trying to scripting multiple servers discovery (add") through the Oneview PowerShell cmdlet. Within in script, I am using the following rest command for multiple servers add;
$discover = Send-OVRequest -Uri "/rest/server-hardware/discovery" -Method Post -Body $body
As body;
$body = @{
"mpHostsAndRanges" = "[10.254.254.2 - 10.254.254.50}"
"username" = "hpeadmin"
"password" = "admin123"
"licensingIntent" = "OneViewStandard"
"configurationState" = "Monitored"
}
but of course, for the parameter "mpHostsAndRanges" , it gives me "string" instead "array."
$body.mpHostsAndRanges.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
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)
$array = @()
for ($i= 1 ; $i -lt 50 ; $i++) {
$array += @("10.254.254.$i")
}
do you have any idea about this issue? how can I define the array within the $body parameter?
Regards,
Cihat
- Tags:
- OneView
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 01:18 AM
03-03-2023 01:18 AM
Re: Oneview server discovery script with Powershell cmdlet
Hello
Please check the below link if that helps you.
Link : https://github.com/HewlettPackard/POSH-HPEOneView/issues/438
Cheers...
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
