I try to understand why this does not work
get-aduser -filter {Name -like "*$($Name.text)*"}
I understand that $($name.text) means can you take this this not a string value "" .
Thank you for your help .
I try to understand why this does not work
get-aduser -filter {Name -like "*$($Name.text)*"}
I understand that $($name.text) means can you take this this not a string value "" .
Thank you for your help .
I'm not 100% sure why that doesn't work, but you could make a temporary string to get around this.
$tmpStr = "*" + $Name.text + "*"
Get-ADUser -Filter {Name -like $tmpStr}