I have made this Little piece of code, that can find a computer owner by searching after name, and then gets the computer owned by that person.
Problem is that I can only enter first name.
Next problem; a first name can be owned by many people, so even though I am searching on the description parameter, I would also very much like it to be showed in the “Description” along side “Name”.
Reason for this is that it helps look up a computer name faster and gets it’s owner, so I don’t have to ask for computer names all the time. I can just look them up here.
Param[ [String]$Name = [Read-Host "Regular Name"], [String]$ComputerOU = [Read-Host "OU is either Windows7 or Windows8"] ] #Find computer owner via AD description field Get-ADComputer -LDAPFilter "[Description=*$Name*]" -SearchBase "OU=$ComputerOU,OU=Computers,OU=LB,DC=LB,DC=NET" | fl Name,Description
I apreciate all the helpfull people in here, thanks in advance for the help.