Searching for a computer in Active Directory using powerShell

Hi,

I am looking into the use of powerShell in a Windows Server Active Directory.
I am new to both, Active Directory and PowerShell. So, please don't assume that I know what I am doing.

All I need here is to be shown how to tweak the following statement to get the properties of a computer which I know exists in Active directory: The computer Name is 14115A.:
Get-AdComputer -Filter { name -Like '*14115A*' } -Properties

Thank you

Adam



If the name is "14115A"
Both of the following will get the computer.
Get-AdComputer -Filter { name -eq '14115A' }
Get-AdComputer '14115A'
You don't need to use -like or the wildcard (*) unless you want to match variations of the name. Both of those commands will just retrieve the default set of properties. If you want other properties, specify them by name with the properties parameter
Get-AdComputer '14115A' -properties OperatingSystem,OperatingSystemServicePack
or use * to retrieve them all.
Get-AdComputer '14115A' -properties *



If the name is "14115A"
Both of the following will get the computer.
Get-AdComputer -Filter { name -eq '14115A' }
Get-AdComputer '14115A'
You don't need to use -like or the wildcard (*) unless you want to match variations of the name. Both of those commands will just retrieve the default set of properties. If you want other properties, specify them by name with the properties parameter
Get-AdComputer '14115A' -properties OperatingSystem,OperatingSystemServicePack
or use * to retrieve them all.
Get-AdComputer '14115A' -properties *



That was very helpful. Thank you very much.







Share this

Related Posts

There was an error in this gadget