<?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 Powershell: enable-ovmaintenancemode in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218430#M9342</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I've got some scheduled downtime soon and it looks like OneView still doesn't have a maintenance schedule option, so I thought i'd use Powershell to do this, however i'm stuck.&lt;BR /&gt;&lt;BR /&gt;I can see the option "enable-ovmaintenancemode" but when I press enter it just says InputObject, no idea what that is.&amp;nbsp; No matter what I type in it says the following&lt;BR /&gt;&lt;BR /&gt;"Enable-OVMaintenanceMode: The specified 'InputObject' is not an object or is missing the 'ApplianceConnection' property. Please correct this value and try again."&lt;BR /&gt;&lt;BR /&gt;What i'm after is something like enable-ovmaintenancemode -servers server1, server2, server3&lt;BR /&gt;&lt;BR /&gt;Can anyone help out?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 03:54:52 GMT</pubDate>
    <dc:creator>DanS2</dc:creator>
    <dc:date>2024-06-27T03:54:52Z</dc:date>
    <item>
      <title>Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218430#M9342</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I've got some scheduled downtime soon and it looks like OneView still doesn't have a maintenance schedule option, so I thought i'd use Powershell to do this, however i'm stuck.&lt;BR /&gt;&lt;BR /&gt;I can see the option "enable-ovmaintenancemode" but when I press enter it just says InputObject, no idea what that is.&amp;nbsp; No matter what I type in it says the following&lt;BR /&gt;&lt;BR /&gt;"Enable-OVMaintenanceMode: The specified 'InputObject' is not an object or is missing the 'ApplianceConnection' property. Please correct this value and try again."&lt;BR /&gt;&lt;BR /&gt;What i'm after is something like enable-ovmaintenancemode -servers server1, server2, server3&lt;BR /&gt;&lt;BR /&gt;Can anyone help out?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 03:54:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218430#M9342</guid>
      <dc:creator>DanS2</dc:creator>
      <dc:date>2024-06-27T03:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218462#M9343</link>
      <description>&lt;P&gt;You need to pass a server object to the Cmdlet.&amp;nbsp; Using &lt;FONT face="courier new,courier"&gt;Get-Help Enable-OVMaintenanceMode&lt;/FONT&gt;, you will get the Cmdlet help showing you how to use it.&amp;nbsp; So, for example, you need to use Get-OVServer first to get the list of servers (or alternatively you can get the Server Profile instead using Get-OVServerProfile):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$Server = Get-OVServer -Name Server
Enable-OVMaintenanceMode -InputObject $Server

# You can also use the PowerShell pipeline
Get-OVServer -Name Server | Enable-OVMaintenanceMode&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jun 2024 15:06:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218462#M9343</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2024-06-26T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218470#M9344</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for that that seems to be working; however how do I remove the prompt for confirmation?&amp;nbsp; I've tried the following&lt;BR /&gt;&lt;BR /&gt;get-ovserver -name servernamehere | enable-ovmaintenancemode -force -confirm:$true&lt;BR /&gt;&lt;BR /&gt;it's saying there isn't a parameter, i'm hoping to have this script created as a scheduled task so needs to run automatically.&lt;BR /&gt;&lt;BR /&gt;Also how can I put in mulitple servers as a list? like servername1,servername2&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 16:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218470#M9344</guid>
      <dc:creator>DanS2</dc:creator>
      <dc:date>2024-06-26T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218471#M9345</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;-Confirm:$false&lt;/FONT&gt; is supposed to override the prompt.&amp;nbsp; -Force isn't a parameter option for &lt;FONT face="courier new,courier"&gt;Enable-OVMaintenanceMode&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 16:15:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218471#M9345</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2024-06-26T16:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218474#M9346</link>
      <description>I’ll be able to test that tomorrow but yes my mistake it should be false not true oops.&lt;BR /&gt;&lt;BR /&gt;Are you able to assist in helping with having multiple servers in the script?&lt;BR /&gt;&lt;BR /&gt;That’s just the final bit I hope, one side of our infrastructure is going down, so I need to be able to have multiple servers go into maintenance mode and not all&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 26 Jun 2024 16:49:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218474#M9346</guid>
      <dc:creator>DanS2</dc:creator>
      <dc:date>2024-06-26T16:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218482#M9348</link>
      <description>&lt;P&gt;One technique you can use is to put these servers into a Scope, then use the Scope resource to get the list of servers.&amp;nbsp; That way, you don't have to use some naming scheme for server names to figure out how to locate them using Get-OVServer.&amp;nbsp; For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;# Get the scope
$Scope = Get-OVScope -Name ServersForMaintenance

# Process scope resources for server hardware, then enable maintenance mode and saving task objects to runtime variable $Tasks
$Scope.Members | ? Type -eq ServerHardware | % { Get-OVServer -Name $_.Name } | Enable-OVMaintenanceMode -OutVariable Tasks&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, you can monitor or view the asynctask(s) status in the $Tasks variable.&amp;nbsp; Use the Wait-OVTaskComplete Cmdlet to monitor the progression of the async tasks.&amp;nbsp; By default, all operation-based Cmdlets, like Enable-OVMaintenanceMode, are blocking while it waits for the task to complete.&amp;nbsp; You can check for Cmdlets that support the -Async parameter switch, which will return the async task object immediately upon being accepted by the appliance.&amp;nbsp; Then use the Wait-OVTaskComplete to monitor as previously stated.&amp;nbsp; Keep in mind that the Wait-OVTaskComplete will timeout after 20 minutes.&amp;nbsp; That does not mean the task failed if the timeout is reached.&amp;nbsp; You can override it with the -Timeout parameter in Wait-OVTaskComplete.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 20:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218482#M9348</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2024-06-26T20:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218519#M9354</link>
      <description>&lt;P&gt;Awesome thank you, thats worked a treat using the scopes, thank you very much &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 08:33:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218519#M9354</guid>
      <dc:creator>DanS2</dc:creator>
      <dc:date>2024-06-27T08:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell: enable-ovmaintenancemode</title>
      <link>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218538#M9356</link>
      <description>&lt;P&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/2173541"&gt;@DanS2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's excellent!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are extremely glad to know the issue has been resolved and we appreciate you for keeping us posted.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 11:05:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/powershell-enable-ovmaintenancemode/m-p/7218538#M9356</guid>
      <dc:creator>Sunitha_Mod</dc:creator>
      <dc:date>2024-06-27T11:05:47Z</dc:date>
    </item>
  </channel>
</rss>

