Computer Owner In PowerShell

I frequently need to figure out who the owner of a computer object is in Active Directory.

Enter PowerShell to the rescue!

image

Easy as pie.  Here is the full code for you to use.

$oADObject = Get-ADComputer <ComputerName> -Properties *
$oAceObj   = Get-Acl -Path (“ActiveDirectory:://RootDSE/” + $oADObject.DistinguishedName);
$oAceObj.Owner

Gist Link: https://gist.github.com/dalehhirt/3f03b9ee27a245933e1a

Advertisements