forked from movinalot/ucs-alexa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet-ImcLed.ps1
31 lines (22 loc) · 914 Bytes
/
Set-ImcLed.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<#
.SYNOPSIS
Set-ImcLed, set the LED state on a UCS Rack Server
.DESCRIPTION
Set-ImcLed, set the LED state on a UCS Rack Server
.NOTES
John McDonough, Cisco Systems, Inc. (jomcdono)
#>
param( [Parameter(Mandatory=$true,HelpMessage="Enter Server IP")]
[string] $Server,
[Parameter(Mandatory=$true,HelpMessage="Enter Server user")]
[string] $User,
[Parameter(Mandatory=$true,HelpMessage="Enter Server user's Password")]
[string] $Pass,
[Parameter(Mandatory=$true,HelpMessage="Enter Server LED state")]
[string] $LedState
);
Import-Module -Name Cisco.IMC
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $User,$(convertto-securestring -Force -AsPlainText $Pass)
$imc_connection = Connect-Imc -Name $Server -Credential $credentials
$(Get-ImcLocatorLed | Set-ImcLocatorLed -AdminState $LedState -Force).OperState
$imc_connection = Disconnect-Imc