question

JefdeJong-2260 avatar image
0 Votes"
JefdeJong-2260 asked LimitlessTechnology-2700 answered

The Powershell command won't give me the results the correct results. (Get-ADUser -Filter * -Properties * | Select Name, whenCreated | Sort-Object whenCreated)

Dear Support,

When i run the following command Get-ADUser -Filter -Properties | Select Name, whenCreated | Sort-Object whenCreated it won't show me the correct output.
I want to have a list with all the users and which date it has been created.

But it won't show me the output. Some users it will show the output. Some users it won't.
See screenshot for more information.

201685-screenshot-33.png


When i check the useraccount attribute information under the user information i found the following results.

201637-screenshot-40.png

Is it's possible to retrieve this with an command? Because i see the information is stored.
Please advise how i can accomplished this with an command.

Greetz,
Jeffrey de Jong



windows-server-powershell
screenshot-33.png (31.9 KiB)
screenshot-40.png (23.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NewbieJones-6218 avatar image
0 Votes"
NewbieJones-6218 answered

For the ones that don't seem to be working, try bringing back just that account and seeing if its truly blank.

 Get-ADUser -Identity xyz -properties whenCreated | Select-Object Name, whenCreated

You are also getting all properties for all users, which will take much longer than you need. Limit the properties to just the ones you need.

 Get-ADUser -Filter * -Properties whenChanged | Select-Object Name, whenCreated

whenCreated should be a replicated attribute, so it should exist on all domain controllers. It may be worth running the command against different domain controllers to ensure that the replication is working properly. As that may account for some being blank.

lastLogin and whenChanged for example are not replicated, so you would have to potentially query all domain controllers to get the most recent date.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NewbieJones-6218 avatar image
0 Votes"
NewbieJones-6218 answered

It's also possible that you don't have full permissions to some objects and that the permissions on some user objects have been modified\broken.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello

Thank you for your question and reaching out.
I can understand you are having some issues related to Ad users when created Date incorrect result.

Please try launch AD powershell from a DC or remote server admin tools and run the following command with elevated mode.

Get-ADUser -filter * -Properties samAccountName,WhenCreated | Select-Object samAccountName,WhenCreated

Also , please ensure AD replication is good in health and all are synced.



--If the reply is helpful, please Upvote and Accept as answer--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.