Trouble with [Microsoft.ActiveDirectory.Management.ADGroup] in a parameter.

Welcome Forums General PowerShell Q&A Trouble with [Microsoft.ActiveDirectory.Management.ADGroup] in a parameter.

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 1 month ago.

  • Author
  • #31629

    Points: 0
    Rank: Member

    I'm trying to create a parameter of the type [Microsoft.ActiveDirectory.Management.ADGroup] and another parameter with the type [Selected.Microsoft.ActiveDirectory.Management.ADGroup], which appears to be a PSCustomObject. When I declare that, it works fine. I'm stuck on the [Microsoft.ActiveDirectory.Management.ADGroup] parameter, though. I've tried Add-Type before the function starts, tried Import-ModuleActive Directory, tried the ReflectionAssembly with PartialName. The results are all the same. 'Cannot bind argument to parameter 'MyParameter' because it is null.

    The actual code is at:

    Has anyone had success with this?

  • #31633

    Points: 0
    Rank: Member

    How are you calling the function? The error you're giving is because you've marked the parameter as Mandatory, but tried to pass in a null value.

The topic ‘Trouble with [Microsoft.ActiveDirectory.Management.ADGroup] in a parameter.’ is closed to new replies.