HPE OneView

Add server with multiple scopes using PowerShell

Go to solution
Honored Contributor

Add server with multiple scopes using PowerShell

OK to  post OneView PowerShell questions in this forum?  If so, here is my question:

Is it possible to specify multiple scopes when using Add-HPOVServer?  The Help says it is an "array" but when I try to specify multiple scopes it fails.  When I try just one scope, it works fine.

In our environment, we have one scope for All Windows servers - so that the team that supports WIndows servers can SEE and MANAGE those devices.  Then we have one or more additional scopes just for alerts.  So if a server is in the "Jonny's Servers" scope, only Jonny will get the email alerts for those servers.  So thus a server could be in two different scopes.

I have tried this:

Add-HPOVServer -ApplianceConnection $Conn -Hostname "SERVERILO" -Credential $ILOCred -Scope $Scope1, $Scope2 -Monitored:$true

and also creating an array of scopes, using the Get-HPOVScope cmdlet and a WHERE-OBJECT clause:

Add-HPOVServer -ApplianceConnection $Conn -Hostname "SERVERILO" -Credential $ILOCred -Scope $Scopes -Monitored:$true

But both attempts fails.  It seems like it will only accept a single scope, not an array.  The help says this (which you can see mentions array):

-Scope [<Array>]
Provide an array of <HPOneView.Appliance.ScopeResource> Scope resource(s) to initially add.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

Any suggestions on what I am doing wrong?




Re: Add server with multiple scopes using PowerShell

This is a bug.  You already submitted an issue to the tracker.  So please continue this discussion over there.

I am an HPE employee

Accept or Kudo

Honored Contributor

Re: Add server with multiple scopes using PowerShell

Apologies - I discovered the GitHub repo after posting on this forum.

Thanks for the help so far.