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

Powershell Error - Can't multithread to Connect-HPOA or Connect-HPBIOS

rookie1082
Advisor

Powershell Error - Can't multithread to Connect-HPOA or Connect-HPBIOS

Hello,
 
PLEASE NOTE:  CONNECT-HPEBIOS (released 10/2017) fixes the issue below.  CONNECT-HPOA STILL HAS THIS ISSUE.


I have a CSV that i'm importing with the fields IP, Username, Password to connect to a large amount of HP systems to set BIOS settings.  It's saying that it's having an error converting my PSOjects from the CSV to strings.

Does anyone have this issue or a workaround?  The recent release of HPEBIOSCmdlets fixed the connect-hpbios issue, but the issue still persists for the HPOACmdlets...

Connect-HPOA : Invalid input: Unable to cast object of type 'System.Management.Automation.PSObject' to type 'System.String'.
Parameter name: OA
At line:1 char:23
+ ... nectOA = $csvOA | Connect-HPOA -WarningAction SilentlyContinue -Force
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Connect-HPOA], ArgumentException
    + FullyQualifiedErrorId : HPOACmdlets.ConnectHPOA
2 REPLIES
GokulKS
Trusted Contributor

Re: Powershell Error - Can't multithread to Connect-HPOA or Connect-HPBIOS

Hi,

Can you share the csv details like how you are inputing the data in csv (you can mask the ip address and other senstive details).

Below is the format of csv you should use incase its worng.

PS C:\Windows\system32> $csv = Import-Csv -Path "C:\Temp\inputcsv.csv" -Verbose

PS C:\Windows\system32> $csv

OA Username Password 
-- -------- -------- 
192.168.10.201 administrator xyz

Thanks,

Gokul

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

Re: Powershell Error - Can't multithread to Connect-HPOA or Connect-HPBIOS

Hi,

It would be more clear if you add  complete command which you are trying to execute.

Looks like you are direct passing imported csv object to Connect-HPOA Cmdlet. That leads to error for type mismatch.

Try it like below snippet.

 

1$csvObj = Import-CSV C:\CsvInput.csv

Connect-HPOA -IP $csvObj.IP -Username $csvObj.Username -Password $csvObj.Password