Lofty Worm
asked on
iLO or DRAC
Does anyone know how I can remotely use a batch/vb/powershell script to turn on a bunch of servers using the HP iLO and also the Dell DRAC??
they are web based applications that you need to log on to - i cant imagine there is any way to do this via wmi or anything like that
You can.. and I have a powershell script that does just that (at least HP.)
You can use the HP CLI or send the Magic Packet.
whats your preference... the magic packet should work for both.
You can use the HP CLI or send the Magic Packet.
whats your preference... the magic packet should work for both.
ASKER
Both please, as this is a learning experience, I will have to see which one works best in our environment. I am pretty sure Dell has a similar command line thing, do you know that one?
btw, magic packet is a new term for me, what is that?
btw, magic packet is a new term for me, what is that?
thats unreal, i am very keen to see that script
I will post it a few... spending time with the wife atm :)
Magic Packet
http://en.wikipedia.org/wiki/Wake-on-LAN
Magic Packet
http://en.wikipedia.org/wiki/Wake-on-LAN
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is my Invoke-iLOCommand.ps1 file. It requires CMDLets from nsoftware. If you dont want to use those you can use plink.exe
nSoftware
http://www.nsoftware.com/powershell/
Plink.exe
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Basically this will send any command you want to the iLO.
In your case
Invoke-iLOCommand.ps1 -cmd "Power On" -server x
nSoftware
http://www.nsoftware.com/powershell/
Plink.exe
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Basically this will send any command you want to the iLO.
In your case
Invoke-iLOCommand.ps1 -cmd "Power On" -server x
# requires snapin Netcmdlets
# Invoke-iLOCommand
Param($cmd = $(throw '$CMD is Required'),
$list,
$server,
$creds = $(Get-Credential),
$filter = ".*"
)
function Ping-Server {
Param([string]$srv)
$pingresult = Get-WmiObject win32_pingstatus -f "address='$srv'"
if($pingresult.statuscode -eq 0) {$true} else {$false}
}
Write-Host
if(!$list -and !$Server){Write-Host "You must Provide a List of Servers or a Server" -fore Yellow}
if($list)
{
if(Test-Path $list)
{
foreach($server in (get-Content $list))
{
if(Ping-Server $Server)
{
Write-Host " + Invoking Command:[$cmd] on Server:[$Server]" -Fore Green
$result = Invoke-SSH -command $cmd -Server $server -Credential $creds -force
$result = $result | Foreach-Object{$_.Text.Split("`n")} | Where-Object{$_ -match $filter}
$result
}
else
{
Write-Host "Ping of Server [$Server] Failed" -fore Red
}
Write-Host
}
}
else
{
Write-Host "Invalid List File [$list]" -fore Red
}
}
if($server)
{
if(Ping-Server $Server)
{
$result = Invoke-SSH -command $cmd -Server $server -Credential $creds -force
$result = $result | Foreach-Object{$_.Text.Split("`n")} | Where-Object{$_ -match $filter}
$result
}
else
{
Write-Host "Ping of Server [$Server] Failed" -fore Red
}
}
Write-Host
ASKER
Thank you :) I will read into this toady. Does anyone have any additions for the Dell DRAC?
that is freakin unreal - especially as i am about to buy a 16 blade enclosure running ILO cards - you have my thanks big time :) very cool
Your welcome. :)
ASKER
Only half of my question, but a great answer all the same, ty :)
How can the above Powershell script be used with Plink.exe?