locked
Get-ADObject: A parameter cannot be found that matches the parameter name 'identity' RRS feed

  • Question

  • I'm using Windows 2012R2 with PS version 5.1.14409.1012 to execute scripts. Sometime in the last couple of weeks a script started failing that uses Get-ADObject -identity <variable containing user or group DN>. The cmdlet appears to no longer include an 'identity' parameter. 

    Get-ADObject -identity on this computer gives me: A parameter cannot be found that matches the parameter name 'identity'

    While the same command on a Windows 2008R2 PS v4.0 accepts that parameter and functions properly--and as stated, the 2012R2 was working as well, until sometime in the last few weeks.

    Anyone know what's going on here?

     

    Tony Auby

    Wednesday, September 19, 2018 6:30 PM

All replies

  • "Identity" only exists in one parameter set out of three.  You are likely using the wrong parameter set.

    See: https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adobject?view=win10-ps


    \_(ツ)_/

    Wednesday, September 19, 2018 6:42 PM
  • UPDATE: The problem is not with the OS or the PS versions. Another identical computer does not show this issue. I would still like to know what could happen that would cause a cmdlet to stop recognizing one of its parameters....this one specifically.

    I checked to make sure i was not loading any modules, etc., that might clobber this cmdlet. Nothing.


    Tony Auby

    Wednesday, September 19, 2018 7:00 PM
  • Without the exact command we cannot guess at what you are doing that would cause this.


    \_(ツ)_/

    Wednesday, September 19, 2018 7:02 PM
  • At this point I am only testing at the cli with just this:  get-adobject -identity

    On the one computer it errors, parameter doesn't exist. On a different 2012R2 and a 2008...and a 2016 -- i get "missing an argument for parameter 'identity". So, the parameter exists.


    Tony Auby

    Wednesday, September 19, 2018 7:04 PM
  • You have to specify a value for the parameter in both cases.


    \_(ツ)_/

    Wednesday, September 19, 2018 8:39 PM
  • Hi Tony,

    Thanks for your question.

    It's diffcult to find what cause it. 

    May be you can try to run "Get-Help Get-ADObject " to check the parameters of this cmdlet.

    Best Regards,

    Lee


    Just do it.

    Thursday, September 20, 2018 7:17 AM
  • Hi,

    Just checking in to see if the information provided was helpful. 
    Please let us know if you would like further assistance.

    Best Regards,
    Lee

    Just do it.

    Tuesday, September 25, 2018 9:29 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    Best Regards,

    LEE


    Just do it.

    Monday, October 8, 2018 5:24 AM