• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
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.

1 ACCEPTED SOLUTION

Accepted Solutions
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

View solution in original post

1 REPLY 1
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

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.