Index error occurs when executing "Test-RDOU Access" command

morinoyokan 1 Reputation point
2021-03-22T09:42:44.427+00:00

<Question>
When executing the cmdlet "Test-RDOU Access", the following message occurred and the command terminated abnormally.
Please tell me the reason why the follow error message is output and how to prevent abnormal termination.

<Error Message>
System.Management.Automation.RemoteException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list

<Supplement>
We use Test-RDOUAccess to check if you have permission to access the OU.
If there is no permission, a script that grants access is created and executed.
We expect a True or False return.

  • Error occured command:
    Test-RDOUAccess -ConnectionBroker xxxx.aaa.bbb.co.jp -OU "OU=XXX,OU=XXX,OU=XXX,OU=Computers,OU=XXX,DC=xxx,DC=xxx,DC=xxx,DC=xxx"
    → Error
  • Success command:
    Test-RDOUAccess -ConnectionBroker xxxx.aaa.bbb.co.jp -OU "OU=XXX,OU=XXX,OU=Computers,OU=XXX,DC=xxx,DC=xxx,DC=xxx,DC=xxx"
    → return OK

The difference between a success command and a failure command is only one less OU hierarchy.

Windows for business Windows Server User experience PowerShell
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.