Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

get-aduser userid -Properties * - throws Object reference not set to instance of an object error #8

Closed
mcurole opened this issue Sep 14, 2018 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@mcurole
Copy link

mcurole commented Sep 14, 2018

Steps to reproduce

get-aduser userid -Properties *

Expected behavior

Command should return user and all properties on the account

Actual behavior

get-aduser : Object reference not set to an instance of an object.
At line:1 char:1
+ get-aduser mcuroleadmin -Properties *
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (mcuroleadmin:ADUser) [Get-ADUser], NullReferenceException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.NullReferenceException,Microsoft.ActiveDirectory.Management.Commands.GetADUser

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 10.0.17751
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@mcurole
Copy link
Author

mcurole commented Sep 14, 2018

One item to note, this bug is found in other commands as well - get-adcomputer and get-adgroup as well

@The-New-Guy
Copy link

The-New-Guy commented Nov 30, 2018

I can confirm that I also see this issue on all my systems as well as my colleagues systems. I'm so eager to stop using Windows PowerShell and just use PowerShell but one of my most commonly used commands when troubleshooting users accounts is to run Get-AdUser -Properties * on their username. Simply way too many AD properties to manually list them all so I have to revert to WindowsPowerShell.

@RichardSiddaway
Copy link

My testing shows that its the ProtectedfromAccidentalDeletion property that may be at the root of the problem. I can retrieve any property but that one and any combination of properties that doesn't contain it.

ProtectedfromAccidentalDeletion isn't actually an AD property - its an ACL that denies the Delete permission to everyone

@SteveL-MSFT SteveL-MSFT transferred this issue from PowerShell/PowerShell Dec 5, 2018
@SteveL-MSFT SteveL-MSFT added the duplicate This issue or pull request already exists label Dec 5, 2018
@SteveL-MSFT
Copy link
Member

This is a dupe of #5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants