HPE OneView
cancel
Showing results for 
Search instead for 
Did you mean: 

Update Enclosure Groups (configuration scripts) via PowerShell

SOLVED
Go to solution
Daniel-L
Frequent Visitor

Update Enclosure Groups (configuration scripts) via PowerShell

I'm looking for a way to "mass update" the configuration scripts of existing Enclosure Groups.

As there seems to be no Update- or Set-HPOVEnclosureGroup Commandlet I'm stuck with manually updating these scripts using the Web UI.

This is somewhat tiresome if you have multiple OneView instances with multple Enclsoure Groups each.

Any suggestions?

Thanks for your support!

Daniel

 

3 REPLIES
ChrisLynchHPE
Neighborhood Moderator
Solution

Re: Update Enclosure Groups (configuration scripts) via PowerShell

In order to update the Configuration Script in an Enclosure Group, you will need to do the following:

 

# Get the Enclosure Group
$EnclosureGroup = Get-HPOVEnclosureGroup -Name MyEg -ErrorAction Stop

# Define the new c-Class OA Configuration Script
$NewConfigurationScript = '# This is my updated OA config script
# with multiple lines'

# Save the configuration script
$results = Send-HPOVRequest -Uri ($EnclosureGroup.uri + '/script') -Method PUT -Body $NewConfigurationScript

# Update associated Logical Enclosures
Get-HPOVLogicalEnclosure | Where-Object { $_.state -ne 'Consisent' } | Update-HPOVLogicalEnclosure -UpdateFromGroup

If you go to the HPE OneView PowerShell Github project, please open an issue for this, as I can then look at enhancing the library to support this workflow in a future release.  Please do include the version of the library you are using.

Daniel-L
Frequent Visitor

Re: Update Enclosure Groups (configuration scripts) via PowerShell

Hello Chris,

thanks for your reply and great support.

I've opened a new issue for this: Enhancement request: Update Enclosure Group configuration scripts #341

Regards,

Daniel

ChrisLynchHPE
Neighborhood Moderator

Re: Update Enclosure Groups (configuration scripts) via PowerShell

Yes, I see the issue on the tracker.