What is the best way to update computer object attributes in AD?

I have a computer object, retrieved using Powershell and I need to update its Managed By
 attribute. What's the best way to do that?
LVL 35
Who is Participating?
With AD Module:

import-module activedirectory
Get-ADComputer yourcomputername | Set-ADComputer -ManagedBy samaccountnameofmanager

With Quest AD Snapin:

Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction silentlycontinue
Get-QADComputer  yourcomputername | Set-QADComputer -ManagedBy samaccountnameofmanager
What solution would you like to see? The Microsoft's AD Module based or Quest's AD Snap-in based?
You can do that in ADSSIEDIT. msc console
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

YZlatAuthor Commented:
i need a programmatic solution using Powershell
YZlatAuthor Commented:
Which one would you recommend and why?
If you have Windows Server 2008 RC DCs then the first is an option, already included in the DC, so it is there.

If you have older DCs, Quest's snapin is the easier option, as it is a client side tool, so no need to install anything on DCs.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.