cancel
Showing results for 
Search instead for 
Did you mean: 
  • ×
    Information
    HP Solution Center Adobe Flash player error

    Please check this document to find the workaround solution for Print and Scan - HP Solution Center doesn't open

    Information
    Fix Windows 10 Update Issues

    Resolve Windows 10 or update issues on HP computer or printer– Click Here

  • post a message
  • ×
    Information
    HP Solution Center Adobe Flash player error

    Please check this document to find the workaround solution for Print and Scan - HP Solution Center doesn't open

    Information
    Fix Windows 10 Update Issues

    Resolve Windows 10 or update issues on HP computer or printer– Click Here

  • post a message
Level 1
2 1 1 0
Message 1 of 2
498
Flag Post

Solved!

Set-HPiLOSchemalessDirectory is not working with variables

HP Recommended
Powershell
Microsoft Windows Server 2016

When trying to set up iLO AD Groups using the HPiLO cmdlets in Powershell, I'm getting an error.  The code line is as follows:

Set-HPiLOSchemalessDirectory -GroupAccount Enable -server $server -DisableCertificateAuthentication - Credential $Creds $str

 

When the code runs, I get the following error:

A positional parameter cannot be found that accepts argument '-Group1Name group -Group1Priv "1,2,3,4,5,6" -Group1SID ""'

$str in the command is the string containing '-Group1Name group...Group1SID ""'

Following Group1SID are 2 double-quotes to make a blank entry ($Null does not work)

The odd thing is that I can manually type the command and replace $str with the copied contents from the error message, and it works fine.   Any assistance would be appreciated.  Thanks.

0 Kudos
1 REPLY 1
Author
Level 1
2 1 1 0
Message 2 of 2
Flag Post
HP Recommended

For those who may have this issue, the problem lies with passing parameters for the powershell cmdlets.  The parameter name (i.e. -group1name, group2name, etc.) may not be passed from within a variable.  It must be a standalone item as is the -server and -Credential parameters shown in the example.  The following would succeed:

Set-HPiLOSchemalessDirectory -GroupAccount Enable -server $server -DisableCertificateAuthentication - Credential $Creds -Group1Name $G1Name -Group1Priv $G1Priv -Group1SID $G1Sid

0 Kudos
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation