0

I am trying to write a basic PowerShell script to Get-ADUser using the UserPrincipleName property. I have tried various items and all of them fail. I have tried

Get-ADUser -Properties {UserPrincipleName -eq "somename@domain.com"}

and have also tried

Get-ADUSer -Properties "someuser@domain.com"

I just am failing to understand how the -properties parameters relates to the UPN.

talway
  • 1
  • 1
  • 2
  • 1
    `-Properties` specifies what (additional) properties to include on the returned objects; it isn't used for filtering. That's what `-Filter` is for: `Get-ADUser -Filter "UserPrincipalName -eq 'somename@domain.com'"`. – Jeroen Mostert Sep 12 '22 at 15:37

0 Answers0