Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Query in Active Directory with, as variable, a attribute prompted the user

$
0
0

Hi to all,

please... where isthe error?

1° line of my script: $args = Read-Host -Prompt "Insert "

2° line of my script: Get-ADUser -Filter 'EmailAddress -like "$args"' -Properties * | fl SamAccountName, EmailAddress

No error is returned but I don't get the results I expect.  Do I need to modify the syntax to accomodate a variable?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>