ProLiant Servers (ML,DL,SL)
1823332 Members
3323 Online
109654 Solutions
New Discussion

Rif.: Query: Remote connection to iLO with powershell

 
Sove
Occasional Advisor

Remote connection to iLO with powershell

Hi,

I would to connect remotely to the iLO 5 to query the power status of the server and power on it when there is a power outage.

I'm trying to use the HPEiLOCmdlets but it gives me the error (401Unauthorized.

I'm using the administrator account.

Do you have some suggestions?
Regards

13 REPLIES 13
Sove
Occasional Advisor

Rif.: Query: Remote connection to iLO with powershell

Hi,

thanks for your reply.

I have the connection error with iLO local administrator user, the same user that I use (withou problem) to connect to the web interface.

 

Marcel_D
Advisor

Rif.: Query: Remote connection to iLO with powershell

Hi, did you try something like this:

Get-Credential -Message "Admin-Account Password" -UserName Administrator
$iloboard = Read-Host
$conn = connect-hpeilo -Address $iloboard -Credential $cred -DisableCertificateAuthentication 

 

Which Version of Cmdlets do you use?

Are you maybe blocked by a Firewall?

Sove
Occasional Advisor

Rif.: Query: Remote connection to iLO with powershell

Hi,

Thanks for your reply.
It gives always the error    (401) Unauthorized

There isn't firewall and with the web interface I can connect correctly.

I'm using powershell version 5.1

the HPEiLOCmdlets version is 4.0 (the latest), but I hav the problem with the 3.3 also.

 

Thanks

Marcel_D
Advisor

Rif.: Query: Remote connection to iLO with powershell

Hi, 

to get help with your problem, there is more Information needed.

Can you post the code, with which you are trying to connect?

What is your ilo-Version? Did you update to the latest?

Sove
Occasional Advisor

Rif.: Query: Remote connection to iLO with powershell

The ILO is v2.65. I have to schedule the update.

I'm using 

Connect-HPEiLO -IP $iloIP -username $ilouser -password $ilopass -DisableCertificateAuthentication

I tried also to create another admin account but I have the same issue. 

Maybe I missing some permissions?

MV3
HPE Pro

Re: Rif.: Query: Remote connection to iLO with powershell

Hello,

The request has not been applied because it lacks valid authentication credentials for the target resource.

Can you please try updating the iLO to the latest Fw and check if that fixes the communication issue?

 

Cheers....



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Sove
Occasional Advisor

Re: Rif.: Query: Remote connection to iLO with powershell

Hi,

I scheduled to update servers with the last SPP available, I see that update the ILO to v2.78.

I'll give you a feedback as soon as I try with last firmware.

Thanks

Sove
Occasional Advisor

Re: Rif.: Query: Remote connection to iLO with powershell

@MV3 

Hi,

I update ILO to v2.78, but the issue has not been resolved.
With ilorest command I can connect without problem (I updated the ILO with it).

How can I reset powershell access permission?

MV3
HPE Pro

Re: Rif.: Query: Remote connection to iLO with powershell

Hello,

Unfortunately i was unable to find steps to reset powershell access permission.

Can you try resetting the ilo to factory default, reconfigure and check if it resloves the issue.

If the issue still persist, raise a support case with HPE for further review.

Cheers....



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
KeSch
Senior Member

Re: Rif.: Query: Remote connection to iLO with powershell

Hi Sove,

i do face the same issue. 

I was able to connect to HPE iLO by using a PSCredentialObject instead. 

This is an example:

[string]$userName = 'localadmin'
[string]$userPassword = 'localpassword'

[securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force

[pscredential]$credObject = New-Object System.Management.Automation.PSCredential ($userName, $secStringPassword)


Connect-HPEiLO -DisableCertificateAuthentication -Address $iLOIP -Credential $credobject

 

Kind regards,

Kevin

Sove
Occasional Advisor

Re: Rif.: Query: Remote connection to iLO with powershell

Hi

Sorry the late reply.

thanks for suggestion but it returns me always the same error...

thutchings
HPE Pro

Re: Rif.: Query: Remote connection to iLO with powershell

Hello,

 

The posts in this thread do not have any clear information on the actual command used to get the power info. I issued the following against an iLO 5 running firmware 2.91:

PS C:\Users\XXXXXX> $conn=Connect-HPEiLO -Address <ip address> -Username <username> -Password <password> -DisableCertificateAuthentication

PS C:\Users\XXXXXX> Get-HPEiLOServerPower -Connection $conn


Power : On
IP : <ip address>
Hostname : ILO-DL380G10D45U33
Status : OK
StatusInfo :

 

I only edited the identifiable information above. I also tested the above against an iLO 5 with 2.72 and got similar results.

 

Regards



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo