PowerShell : Add-Computer cmdlet issue in PowerShell v2 in Windows 7

Apparently there is an issue with Add-Computer cmdlet in PowerShell V2 version of Windows 7. This cmdlet according to the help (examples) allow you to join a machine to the domain. I was successful in renaming the machine with the Rename-Computer cmdlet but had issues adding the machine to the domain. Keep in mind that in Windows 7 and Windows Server 2008, you have to launch PoSH with elevated privileges, even if you are logged on as an Admin. You have to right click on the shortcut and do “run as administrator”, see screenshot 1 for the error you receive, if you don’t.

Then I take a look at the help and confirm that the syntax being passed is the right one and try with the computername,

A different error as if the credentials being password are not sufficient which is not the case as they are of Domain Admins’

While that issue gets fixed, Kirk from over at PowerGUI forums has this QAD cmdlet alternative for you as the solution.

C:\PS>new-qadObject -ParentContainer 'OU=ComputersOU,DC=company,DC=com' -type 'computer' -name 'comp1' -ObjectAttributes @{sAMAccountName='comp1'}

 

tags:
posted in PowerShell by Rick

Follow comments via the RSS Feed | Leave a comment | Trackback URL

1 Comment to "PowerShell : Add-Computer cmdlet issue in PowerShell v2 in Windows 7"

  1. Add-Computer cmdlet works in Windows 7 RTM - Shariq Sheikh | Port 389 wrote:

    [...] had earlier posted about the Add-Computer cmdlet bug in Windows 7 RC builds which didn’t allow the computer to be added to the domain via PowerShell. [...]

Leave Your Comment

 
(c) 2008 - 2012 Shariq Sheikh. All Rights Reserved.