helllo all of you,
I dont understand how a variable is replaced in filter used with Get-ADcomputer.
the following function is generating an error :
function GetComputerListForAService([string] $serviceIdentifier = "A0001", [string] $machineType )
$computerlist = Get-ADComputer -Filter "Name -like '*$serviceIdentifier*'" | select -expand name
but the following line is giving the expected answer
PS > Get-ADComputer -Filter "Name -like '*A0001*'" | select -expand name
what am i missing with my function ?
thank you in advance for your help.