[ad_1]
I have two commands that aim to search for the Input Hostname:
$Hostname = Read-Host -Prompt "Which HOSTNAME do you want to search for?"
Get-ADComputer -Filter {Name -like $Hostname* } -Server {domain.org} | Sort-Object
How do I make this work? I want to make it interchangably so that I can put in the name I want to search and it executes it for me but I want to search all Hostname that start with $Hostname not just $Hostname thats why I put the * there but that doesnt seem to work. Does anyone have a suggestion?
[ad_2]