< Back

Get-HPERedfishMessage

Tue Jan 14, 2020 1:58 am

NAME Get-HPERedfishMessage



SYNOPSIS

Retrieves message details from the MessageId returned from the API.





SYNTAX

Get-HPERedfishMessage [-MessageID] <String> [[-MessageArg] <Object>] [[-Session] <PSObject>]

[-DisableCertificateAuthentication] [<CommonParameters>]





DESCRIPTION

This cmdlet retrieves details of the API response messages specified by the MessageID parameter. This error

message may be informational or warning message and not necessarily an error. The possible messages are specified

in the Data Model Reference document. The MessageIds and required arguments are obtained in the returned objects

by executing cmdlets like Set-HPERedfishData, Edit-HPERedfishData etc.





PARAMETERS

-MessageID <String>

API response message object returned by executing cmdlets like Set-HPERedfishData and Edit-HPERedfishData.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-MessageArg <Object>

API response message arguments returned in the message from cmdlets like Set-HPERedfishData,

Edit-HPERedfishData, etc. The MessageArg parameter has an array of arguments that provides parameter names

and/or values relevant to the error/messages returned from cmdlet execution.



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Session <PSObject>

Session PSObject returned by executing Connect-HPERedfish cmdlet. It must have RootURI and X-Auth-Token for

executing this cmdlet.



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-DisableCertificateAuthentication [<SwitchParameter>]

If this switch parameter is present then server certificate authentication is disabled for the execution of

this cmdlet. If not present it will execute according to the global certificate authentication setting. The

default is to authenticate server certificates. See Enable-HPERedfishCertificateAuthentication and

Disable-HPERedfishCertificateAuthentication to set the per PowerShell session default.



Required? false

Position? named

Default value False

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

You can pipe the MessageID parameter to Get-HPERedfishMessage.





OUTPUTS

System.Management.Automation.PSCustomObject

Get-HPERedfishMessage returns a PSCustomObject that has the error details with Description, Mesage, Severity,

Number of arguments to the message, parameter types and the resolution.





NOTES





See typical usage examples in the HPERedfishExamples.ps1 file installed with this module.



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



PS C:\\>$LoginNameToModify = 'TimHorton'



PS C:\\> $accounts = Get-HPERedfishDataRaw -Odataid '/redfish/v1/AccountService/Accounts/' -Session $s

PS C:\\> $reqAccount = $null

foreach($acc in $accounts.Members.'@odata.id')

{

$accountInfo = Get-HPERedfishDataRaw -Odataid $acc -Session $s

if($accountInfo.UserName -eq $LoginNameToModify)

{

$reqAccount = $accountInfo

break;

}

}

PS C:\\> $priv = @{}

$priv.Add('VirtualMediaPriv',$false)

$priv.Add('UserConfigPriv',$false)



$hp = @{}

$hp.Add('Privileges',$priv)



$oem = @{}

$oem.Add('Hp',$hp)



$user = @{}

$user.Add('Oem',$oem)



PS C:\\> $ret = Set-HPERedfishData -Odataid $reqAccount.'@odata.id' -Setting $user -Session $s

PS C:\\> $ret



Messages Name Type

-------- ---- ----

{@{MessageID=Base.0.10.AccountModified}} Extended Error Information ExtendedError.0.9.6





PS C:\\> $errDetails = Get-HPERedfishMessage -MessageID $ret.error.'@Message.ExtendedInfo'[0].MessageId -Session $s



PS C:\\> $errorDetails





Description : The account was modified successfully.

Message : The account was modified successfully.

Severity : OK

NumberOfArgs : 0

Resolution : None.



This example shows modification of user privilege for a user and the retrieved message details. First the Odataid

of the user 'TimHorton' is seacrched from Accounts odataid. Then user object is created with the required

privilege change. This object is then used as the setting parameter value for Set-HPERedfishData cmdlet. When the

user details are modified, the details of the returned object are retrieved using 'Get-HPERedfishMessage' cmdlet.











RELATED LINKS

http://www.hpe.com/servers/powershell