< Back
Remove-HPERedfishData
Post
NAME Remove-HPERedfishData
SYNOPSIS
Executes HTTP DELETE method on destination server.
SYNTAX
Remove-HPERedfishData [-Odataid] <String> [[-Session] <PSObject>] [-DisableCertificateAuthentication]
[<CommonParameters>]
DESCRIPTION
Executes HTTP DELETE method on the desitination server at the location pointed to by Odataid parameter. Example of
usage of this cmdlet is removing an iLO user account.
PARAMETERS
-Odataid <String>
Odataid of the data which is to be deleted.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Session <PSObject>
Session PSObject returned by executing Connect-HPERedfish cmdlet. It must have RootURI to create the complete
URI along with the Odataid parameter. The root URI of the Redfish data source and the X-Auth-Token session
identifier required for executing this cmdlet is obtained from Session parameter.
Required? false
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
<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 Odataid to Remove-HPERedfishData. Odataid points to the location where the DELETE method is to be
executed.
OUTPUTS
System.Management.Automation.PSCustomObject
Remove-HPERedfishData returns a PSObject that has message from the HTTP response. The response may be
informational or may have a message requiring an action like server reset.
NOTES
- Edit-HPERedfishData is for HTTP PUT method
- Invoke-HPERedfishAction is for HTTP POST method
- Remove-HPERedfishData is for HTTP DELETE method
- Set-HPERedfishData is for HTTP PATCH method
See typical usage examples in the HPERedfishExamples.ps1 file installed with this module.
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$users = Get-HPERedfishDataRaw -Odataid /redfish/v1/accountService/accounts/ -Session $s
foreach($user in $users.Members.'@odata.id')
{
$userDetails = Get-HPERedfishDataRaw -Odataid $user -Session $s
if($userDetails.Username -eq 'user1')
{
Remove-HPERedfishData -Odataid $userDetails.'@odata.id' -Session $s
break
}
}
In this example, first, all accounts are retrieved in $users variable. This list is parsed one by one and when the
'user1' username is found, it is removed from the list of users.
RELATED LINKS
http://www.hpe.com/servers/powershell
SYNOPSIS
Executes HTTP DELETE method on destination server.
SYNTAX
Remove-HPERedfishData [-Odataid] <String> [[-Session] <PSObject>] [-DisableCertificateAuthentication]
[<CommonParameters>]
DESCRIPTION
Executes HTTP DELETE method on the desitination server at the location pointed to by Odataid parameter. Example of
usage of this cmdlet is removing an iLO user account.
PARAMETERS
-Odataid <String>
Odataid of the data which is to be deleted.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Session <PSObject>
Session PSObject returned by executing Connect-HPERedfish cmdlet. It must have RootURI to create the complete
URI along with the Odataid parameter. The root URI of the Redfish data source and the X-Auth-Token session
identifier required for executing this cmdlet is obtained from Session parameter.
Required? false
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
<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 Odataid to Remove-HPERedfishData. Odataid points to the location where the DELETE method is to be
executed.
OUTPUTS
System.Management.Automation.PSCustomObject
Remove-HPERedfishData returns a PSObject that has message from the HTTP response. The response may be
informational or may have a message requiring an action like server reset.
NOTES
- Edit-HPERedfishData is for HTTP PUT method
- Invoke-HPERedfishAction is for HTTP POST method
- Remove-HPERedfishData is for HTTP DELETE method
- Set-HPERedfishData is for HTTP PATCH method
See typical usage examples in the HPERedfishExamples.ps1 file installed with this module.
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$users = Get-HPERedfishDataRaw -Odataid /redfish/v1/accountService/accounts/ -Session $s
foreach($user in $users.Members.'@odata.id')
{
$userDetails = Get-HPERedfishDataRaw -Odataid $user -Session $s
if($userDetails.Username -eq 'user1')
{
Remove-HPERedfishData -Odataid $userDetails.'@odata.id' -Session $s
break
}
}
In this example, first, all accounts are retrieved in $users variable. This list is parsed one by one and when the
'user1' username is found, it is removed from the list of users.
RELATED LINKS
http://www.hpe.com/servers/powershell