How Do I Find Out the Computer Name (hostname) Associated to the User's Account.


I need to know this user's computer name since we go by Asset Tag number. Is there a  way in Active Directory that I can search it?

Thank a lot!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
Take a look in DHCP connections and see if the computer name shows up with the IP address. I think it might.
ShawyenAuthor Commented:
It does not associate the comupter name with the user's domain name.
JohnBusiness Consultant (Owner)Commented:
Anyone can use any computer on a domain, so all you will get are what computers are connected.

If you want to see who is logged on, you will have to turn on auditing on the server and then you can find out going forward.
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

NVITEnd-user supportCommented:
There is nothing built-in to AD that does what you want.

You can query the security logs of the DC for various events that show when was the user's last logon on their computer.
Robin CMSenior Security and Infrastructure EngineerCommented:
Here's some Powershell I wrote that should find IP addresses and computers that have generated a logon event for a particular user. Be warned, this is probably extremely slow, depending on how many user/computers/servers you have.
Guy LidbetterCommented:
I wrote this just for fun....

It will query each PC for the logged on user using WMI and then tell you the PC Name. But the user needs to be currently logged on.

You can modify it to look only in a specific OU or just grab every PC on the Domain.

P.s. its also very slow

$Cred = Get-Credential #Account with perms to query all PC's
$User = "domain\logonaccount" #User logon name
$Domain = "dc=domain,dc=contoso,dc=com"

#This bit is to avoid a referal error in multiple domain forests
$DName = ($User.Split('\'))[0] 
$DomainDC = (netdom query /d:$Dname dc)[2]

$Computers = Get-ADComputer -Filter * -SearchBase $Domain -SearchScope 2 -Server $DomainDC | select name
Foreach ($Computer in $Computers) {
	$Alive = $False
	$Alive = Test-Connection -Computer $ -Count 1 -ErrorAction SilentlyContinue
	IF ($Alive) {
		Try {
			Get-WmiObject -Computer $ Win32_ComputerSystem -Credential $Cred | Where {$_.username -eq $User} | Select Name
		Catch {}

Open in new window

Robin CMSenior Security and Infrastructure EngineerCommented:
What I actually do is to record the user and computer names in an SQL database via my logon script.
This makes it super fast to know which PC a user is/has been on.
You might also be able to query SCCM for this information if you have that.
AmitIT ArchitectCommented:
Use this free tool PsLoggedon from pstools. Download from here:

Give username and hit enter.

PsLoggedon.exe username

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ShawyenAuthor Commented:
Thanks a lot for offering me several alternatives! I will defintately try them!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.