Consider an example, to find computer name 'comp-1' in active directory, use below command Get-ADComputer -Filter "name -eq 'comp-1'" In the above example, it returns the computer name if get-adcomputer filter name like 'comp-1' in active directory. However, if you want to use a computer name stored in a variable and find it $comp = "comp-1" Get-ADComputer -Filter "name -eq '$comp'"