J
J
Janus742016-06-06 16:57:35
PowerShell
Janus74, 2016-06-06 16:57:35

How to debug Get-ADUser?

Hello!
When calling a cmdlet with the following parameters: Get-ADUser -filter * -property *
I get the following error:

Get-ADUser : Ссылка на объект не указывает на экземпляр объекта.
строка:1 знак:1
+ Get-ADUser -filter * -property * | select name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ADUser], NullReferenceException
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.NullReferenceException,Microsoft.ActiveDirectory.Management.Commands.GetADUser

I know that a specific user is causing the error, apparently something is wrong in the account.
1. How to find out what is wrong with the account and fix it?
2. How to handle the error so that the Get-ADUser cmdlet continues to work, rather than being interrupted due to an error?
Thank you!
ps Get-ADUser -filter * - works without errors, but with -property * an error occurs

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-06-06
@yellowmew

add -erroraction silentlycontinue
In general, you should not search for users all over AD at once,
limit the scope of the searchbase
Or do you have a mess in AD and users were created anywhere?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question