Score:-1

Powershell 5.1 - Get-ADUser fails to find user unless running as Administrator

ph flag

I just ran into an issue I cannot explain and need help. I'm on a domain controller (as a domain admin) running Powershell 5.1.

I'm searching for a specific user that I simply cannot find, but I know it's there. I can see it in ADUC, and I can see it via Powershell on my own PC.

Note: I am querying this DC specifically so it's not a replication issue.

get-aduser -filter {samAccountName -eq 'testuser'} -Server dc01 

With that said, I have just realized that if I relaunch Powershell as Administrator, the user is then found!!!

I did a further check to see if there are other users exhibiting this same issue, however when comparing the count between an admin vs non-admin session, it differs by a single number, which is this one particular account.

I have never in my 20+ years of AD administration seen something like this. What on earth could cause this?

Score:0
ph flag

Nevermind. I figured it out. Looks like someone has messed around with the permissions and for whatever reason Authenticated Users no longer has read privileges on the account and this is triggering UAC.

Permissions missing is one thing, but more odd is this is only affecting Powershell. ADUC is totally fine.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.