HPE OneView
1827295 Members
2310 Online
109717 Solutions
New Discussion

HPE Onview - Powershell

 
PhS-
Valued Contributor

HPE Onview - Powershell

Hello, 

I would like to export the CSV (Appliance / Reports / BMC IP Address Inventory ) using Powershell HPEOneView.800.

Is there a way to do that ?

7 REPLIES 7
GM_M
HPE Pro

Re: HPE Onview - Powershell

Hi PhS-,

To export report to CSV format use the parameter -exportfile <file-location>  with .csv extention.
Please use this link to refer for an example 

https://hpe-docs.gitbook.io/posh-hpeoneview/cmdlets/v5.40/networking/show-ovlogicalinterconnectmactable#example-3

Thanks and Regard,
Manoj.



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]
Accept or Kudo
PhS-
Valued Contributor

Re: HPE Onview - Powershell

Thanks for your reply @GM_M 

I can very well imagine that the " -exportfile <file-location>  with .csv extention " is what I have to use as option, but my question was on which command itself ?

You  are pointing me to Show-OVLogicalInterconnectMacTable , but I don't believe this matches the info I am searching for.

I would like to export all the  "BMC IP addresses inventory.csv"

 

Rama2
HPE Pro

Re: HPE Onview - Powershell

>> Procedure to export the BMC IP Address Inventory report as a CSV file using PowerShell in HPE OneView <<

 

Use the Connect-HPOVMgmt cmdlet to connect to your HPE OneView appliance if you haven't already.

Connect-HPOVMgmt -Appliance <OneViewAddress> -UserName <Username> -Password <Password>

 

Retrieve BMC IP Address Information: You can use the Get-HPOVBmc cmdlet to retrieve information about BMCs. Then, select the relevant properties and store them in a variable.

 

$bmcInfo = Get-HPOVBmc

$bmcInfo = $bmcInfo | Select-Object Name, IPAddress

 

Export to CSV: Now, you can export the BMC IP address information to a CSV file using the Export-Csv cmdlet.

 

$csvFilePath = "C:\Path\To\Your\BMC_IP_Addresses.csv"

$bmcInfo | Export-Csv -Path $csvFilePath -NoTypeInformation

 

Replace "C:\Path\To\Your\BMC_IP_Addresses.csv" with the actual path and filename where you want to save the CSV file.

 

Disconnect-HPOVMgmt



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]
Accept or Kudo
PhS-
Valued Contributor

Re: HPE Onview - Powershell

$bmcInfo = Get-HPOVBmc

Get-HPOVBmc: The term 'Get-HPOVBmc' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I am using the latest : HPEOneView.800 8.0.3528.2178

Rama2
HPE Pro

Re: HPE Onview - Powershell

I hope this will create a CSV file containing the BMC IP Address Inventory report.

# Import the HPEOneView.800 module
Import-Module HPEOneView.800

# Connect to the HPE OneView appliance
Connect-HPOVServer -Hostname <hostname> -Username <username> -Password <password>

# Get the BMC IP Address Inventory report
$report = Get-HPOVBmcIpAddressInventoryReport

# Export the report to a CSV file
$report | Export-Csv -Path <path-to-csv-file> -NoTypeInformation


Replace <hostname>, <username>, <password>, and <path-to-csv-file> with appropriate values 



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]
Accept or Kudo
PhS-
Valued Contributor

Re: HPE Onview - Powershell

@Rama2 ,

 The term 'Get-HPOVBmcIpAddressInventoryReport' is not recognized as a name of a cmdlet, function, script file, or executable program. 

Rama2
HPE Pro

Re: HPE Onview - Powershell

Sorry for the confusion. There is no direct option to obtain the BMC IP Address Inventory report. Only the following options are available:


- Get-OVEnclosure
- Get-OVlloSso
- Get-OVLogicalEnclosure
- Get-OVOSDeploymentPlan
- Get-OVOSDeploymentServer
- Get-OVServer
- Get-OVServerOneTimeBoot
- Get-OVServerProfileConnectionList
- Get-OVServerProfileTemplate
- Get-OVComposerNode
- Get-OVEnclosureGroup
- Get-OVlmageStreamerAppliance
- Get-OVMigratableServer
- Get-OVOSDeploymentPlanAttribute
- Get-OVRackManager
- Get-OVServerHardwareType
- Get-OVServerProfile
- Get-OVServerProfileMessage

If any further assistance needed kindly refer to the HPE OneView PowerShell Library :- https://hpe-docs.gitbook.io/posh-hpeoneview/cmdlets/v8.30



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]
Accept or Kudo