< Back

Connect-HPERedfish

Tue Jan 14, 2020 1:52 am

NAME Connect-HPERedfish



SYNOPSIS

Creates a session between PowerShell client and the Redfish data source.





SYNTAX

Connect-HPERedfish [-Address] <String> [-Username] <String> [-Password] <String>

[-DisableCertificateAuthentication] [-DisableExpect100Continue] [<CommonParameters>]



Connect-HPERedfish [-Address] <String> [-Credential] <PSCredential> [-DisableCertificateAuthentication]

[-DisableExpect100Continue] [<CommonParameters>]





DESCRIPTION

Creates a session between the PowerShell client and the Redfish data source using HTTP POST method and returns a

session object. The session object has the following members:

1. 'X-Auth-Token' to identify the session

2. 'RootURI' of the Redfish data source

3. 'Location' which is used for logging out of the session.

4. 'RootData' includes data from '/redfish/v1/'. It includes the refish data and the odata id of components like

systems, chassis, etc.





PARAMETERS

-Address <String>

IP address or Hostname of the target HPE Redfish data source.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Username <String>

Username of iLO account to access the HPE Redfish data source.



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Password <String>

Password of iLO account to access the iLO.



Required? true

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Credential <PSCredential>



Required? true

Position? 2

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



-DisableExpect100Continue [<SwitchParameter>]



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 Address i.e. the hostname or IP address to Connect-HPERedfish.





OUTPUTS

System.Management.Automation.PSCustomObject

Connect-HPERedfish returns a PSObject that has session details - X-Auth-Token, RootURI, Location and RootData.





NOTES





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



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



PS C:\\>$s = Connect-HPERedfish -Address 192.184.217.212 -Username admin -Password admin123



PS C:\\> $s|fl





RootUri : https://192.184.217.212/redfish/v1/

X-Auth-Token : e02ce457b3fa4ad10f9ebc64d33c1445

Location : https://192.184.217.212/redfish/v1/Sess ... 2020c49bb/

RootData : @{@odata.context=/redfish/v1/$metadata#ServiceRoot/; @odata.id=/redfish/v1/;

@odata.type=#ServiceRoot.1.0.0.ServiceRoot; AccountService=; Chassis=; EventService=; Id=v1; JsonSchemas=; Links=;

Managers=; Name=HP RESTful Root Service; Oem=; RedfishVersion=1.0.0; Registries=; SessionService=; Systems=;

UUID=8dea7372-23f9-565f-9396-2cd07febbe29}









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



PS C:\\>$cred = Get-Credential



PS C:\\> $s = Connect-HPERedfish -Address 192.184.217.212 -Cred $cred

PS C:\\> $s|fl





RootUri : https://192.184.217.212/redfish/v1/

X-Auth-Token : a5657bdsgfsdg3650f9ebc64d33c3262

Location : https://192.184.217.212/redfish/v1/Sess ... ad6g25fg6/

RootData : @{@odata.context=/redfish/v1/$metadata#ServiceRoot/; @odata.id=/redfish/v1/;

@odata.type=#ServiceRoot.1.0.0.ServiceRoot; AccountService=; Chassis=; EventService=; Id=v1; JsonSchemas=; Links=;

Managers=; Name=HP RESTful Root Service; Oem=; RedfishVersion=1.0.0; Registries=; SessionService=; Systems=;

UUID=8dea7372-23f9-565f-9396-2cd07febbe29}











RELATED LINKS

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