Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HP iLO / Dell iDRAC Platform Errors #491

Open
imdroc opened this issue Jul 2, 2023 · 1 comment
Open

HP iLO / Dell iDRAC Platform Errors #491

imdroc opened this issue Jul 2, 2023 · 1 comment

Comments

@imdroc
Copy link

imdroc commented Jul 2, 2023

I found couple of issues:
For HP ILO: Imposible to do a "BULK" upload since always ask for platform matchings
PS>New-SafeguardAsset -Platform HP iLO -AcceptSshHostKey -AssetPartition iLO -Description "iLO" -DisplayName https://server01.domain -NetworkAddress server01.domain -ServiceAccountCredentialType None
Searching for platforms with 'HP'
Found 3 platforms matching 'HP':
[
518 - HP iLO
519 - HP iLO MP
517 - HP-UX
]
Enter platform ID or search string:

For Dell iDRAC: problem with the Service Account Credential Type not allowing None as a value.
PS> New-SafeguardAsset -Platform Dell iDRAC -AcceptSshHostKey -AssetPartition iDRAC -Description "iDRAC" -DisplayName https://server02.domain -NetworkAddress server02.domain -ServiceAccountCredentialType None
Searching for platforms with 'Dell'
400: Bad Request -- 60034: A service account ID or name cannot be specified with this credential type.
En C:\Users\imdro\OneDrive\Documents\WindowsPowerShell\Modules\safeguard-ps\7.2.100578\sg-utilities.psm1: 181 Carácter: 5

  • throw $local:ExceptionToThrow
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (:) [], SafeguardMethodException
    • FullyQualifiedErrorId : 400: Bad Request -- 60034: A service account ID or name cannot be specified with this credential type.
@JeffHarkavy
Copy link
Contributor

@imdroc When passing a multi-word platform name the value must be quoted, e.g.,

New-SafeguardAsset -Platform "HP iLO" -AcceptSshHostKey -AssetPartition iLO[...]
Searching for platforms with 'HP iLO'
Found 2 platforms matching 'HP iLO':
[
    518 - HP iLO
    519 - HP iLO MP
]
Enter platform ID or search string:

In the case of HP iLO, because the platform name matching uses a startsWith search it will still find both HP iLO and HPiLO MP. In cases like this you should use a pre-assigned platform object or the platform ID in place of the name

$hpIloPlatform = ((get-safeguardplatform) | where-object {$_.Name -eq "HP iLO"})[0]
New-SafeguardAsset -Platform $hpIloPlatform  -AcceptSshHostKey -AssetPartition iLO[...]

or

New-SafeguardAsset -Platform 518 -AcceptSshHostKey -AssetPartition iLO[...]

This also applies to the Dell iDRAC example. The system is searching for a platform named "Dell" and finding the correct platform (only one starts with that text) but is then taking the "iDRAC" portion as the next piece of data, which in this case is -ServiceAccountSecretKey. If you put quotes around the platform name it should work correctly

New-SafeguardAsset -Platform "Dell iDRAC" -AcceptSshHostKey [...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants