Server Management - Remote Server Management
cancel
Showing results for 
Search instead for 
Did you mean: 

AlertMail with powershell

checkmkuser
Occasional Contributor

AlertMail with powershell

hi All

 

i need to setup emails alerts in hp ilo

i see below powershell cmdlets

 

Get-HPiLOPowerAlertThreshold
Set-HPiLOPowerAlertThreshold
Set-HPOAAlertmail
Test-HPOAAlertMail

 

 

i tried Set-HPOAAlertmail , with no luck

 

OA - cmdlets if i remembers are only for blade hardware & not prolient hardware ?

 

the man page also does not give clear picture as to how to set this up 

 

PS C:\> get-help Set-HPOAAlertmail -full

NAME
Set-HPOAAlertmail

SYNOPSIS
Enables or disables the sending of alert emails when an event occurs and edits the Alertmail settings.

(C) Copyright 2014 Hewlett-Packard Development Company, L.P.

SYNTAX
Set-HPOAAlertmail [-Connection] <Renci.SshNet.SshClient object or list of Renci.SshNet.SshClient objects> [-State
<String, PSObject, list of String and/or PSObject>] [-Email <String, PSObject, list of String and/or PSObject>]
[-Domain <String, PSObject, list of String and/or PSObject>] [-SMTPServer <String, PSObject, list of String and/or
PSObject>] [-OutputType <String>] [-Force] [<CommonParameters>]


DESCRIPTION
The Set-HPOAAlertmail cmdlet enables or disables the sending of alert emails when an event occurs and edits the
Alertmail settings. You can only set the state to enable if the configuration has been set up.

A list of connection objects must be provided as a parameter. OA administrator or OA operator access is required
to execute this cmdlet.


PARAMETERS
-Connection <Renci.SshNet.SshClient object or list of Renci.SshNet.SshClient objects>
Connection object to an OA. This is a session object which identifies the Host to which the connection is
established. The Connection object is created by the Connect-HPOA command using the IP/Hostname and
accompanying Username and Password to log into the OA.

Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-State <String, PSObject, list of String and/or PSObject>
Enables or disables alert mails when an event occurs. Possible values are Enable and Disable.

Required? false
Position? Named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Email <String, PSObject, list of String and/or PSObject>
Email address to which the alert mails are sent.

Required? false
Position? Named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Domain <String, PSObject, list of String and/or PSObject>
Identifies the DNS domain where the Onboard Administrator is located (for example, AB.com).

Required? false
Position? Named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-SMTPServer <String, PSObject, list of String and/or PSObject>
Identifies the mail server where the Onboard Administrator delivers its e-mail based events.

Required? false
Position? Named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-OutputType <String>
Specifies the type of required output. Possible value can be RawText or PSObject. Default value is PSObject.

Required? false
Position? Named
Default value PSObject
Accept pipeline input? false
Accept wildcard characters? false

-Force
Suppresses the prompt for a required parameter. Without this parameter, Set-HPOAAlertmail requires you to
provide the values of all required parameters.

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

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS
PSObject OR array of PSObject OR String OR array of String

 

You can pipe one connection object or a list of connection objects, or one PSObject or list of PSObjects
having the Connection object and other parameter values to be modified.


OUTPUTS


When the cmdlet does not execute correctly, output with the error message is produced. Otherwise, this cmdlet
does not generate any output.

Use Get-Member to get details of fields in returned objects.


NOTES


None


-------------------------- EXAMPLE 1 --------------------------

PS C:\> Set-HPOAAlertmail -Connection $connection -State Enable -Email xxxx@hp.com -Domain China.com -SMTPServer
xx.xx.xx.xx


In this example the list of OA connection is passed as parameters along with State, Email, Domain, and SMTPServer.

-------------------------- EXAMPLE 2 --------------------------

PS C:\> $connection | Set-HPOAAlertmail -State Disable Email xxxx@hp.com -Domain China.com -SMTPServer xx.xx.xx.xx


In this example $connection is passed as parameter to the cmdlet through pipeline. It can be an Object or an
Object array returned from Connect-HPOA.


RELATED LINKS
http://www.hp.com/go/powershell

 

PS C:\>

 

Anyone has any luck with this ?

 

 

 

 

8 REPLIES
GokulKS
Valued Contributor

Re: AlertMail with powershell

Hi,

Can you paste the cmdlet with input parameters you tried on your system so that i can check what you tried is correct or not.

Thanks,

Gokul

Don't forget to give Kudos if the problem got resolved or like suggestion.
GZahidi
Advisor

Re: AlertMail with powershell

Hi ,

You can use following iloCmdlets to alert mail on ILO

1) Set-HPiLOGlobalSetting   :- For more details please check help of this cmdlet.

2) Get-HPiLOGlobalSetting :- to check the status of ALert mail 

 

Example :- 

Set-HPiLOGlobalSetting -Server xxxxxx -Username xxxx -Password xxxx - AlertMail Enabled -AlertMailEmail xyz@domain.com -AlertMailSenderDomain  domian.com -AlertMailSMTPServer XXXXXxXXXX

Please execute the cmdlet as per above example.

Verify the same by executing Get-HPILOGlobalSetting.

Thanks 

Unlisted
Advisor

Re: AlertMail with powershell

Reply originally by  Paddy H

I Had to do this as I kept getting an error

Set-HPiLOGlobalSetting -Server $server -Credential $ilocreds -AlertMail Enable -AlertMailEmail "$AlertMailEmail" -AlertMailSenderDomain "$domain" -AlertMailSMTPPort 25 -AlertMailSMTPServer "$emailServer"

All these params had to be included for the command to work

GokulKS
Valued Contributor

Re: AlertMail with powershell

Hi,

Yes you need send all the required parameters here. You can confirm that by checking the help which are parameters are mandatory.

Thanks,

Gokul

 

Don't forget to give Kudos if the problem got resolved or like suggestion.
Cool_Abdul
Occasional Visitor

Re: AlertMail with powershell

Hi guys

I tried the below command to configure Alert mail and is successful, but hpoaalertmail command is missing the properties (attached the screenshot) of AlertSenderName, Alert Sender Domain, and Alert Sender E-mail. 

Set-HPOAAlertmail -Connection $connection -State Enable -Email xxxx@hp.com -Domain China.com -SMTPServer
xx.xx.xx.xx

Can you guys please suggest how to configure these details in HP Blade Enclosure. 

 

GZahidi
Advisor

Re: AlertMail with powershell

As of now Set-HPOAAlertMail does not provides the parameter to set the sender username and sender domain name.

If you want to configure it you can use  OA CLI command or OA web GUI.

Set-HPEOAAlrtMail with new parametrs will be vailable by August end.

Cool_Abdul
Occasional Visitor

Re: AlertMail with powershell

Thanks for the reply Zahidi. 

I think using OA CLI command we need the login to into every blade enclosure and set the Alert mail. We have around 30 blade Enclosure and it is going to take time to configure them with Alert mail.

GZahidi
Advisor

Re: AlertMail with powershell

Hi Abdul,

 Yes you need to login on each enclosure and do the setting.

 As per your requirement you are looking for following settings

 SenderDomain :- actually the -Domain parameter is for the sender domain.

 SenderName and SenderEmail :- This feature is not available through Set-HPOAAlertMail, This will be available  in upcoming release.