Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy a user account from my production domain to my test domain. Here is what I am trying:

$me = Get-QADUser myAccount -IncludeAllProperties -connection $prodDomain
$me | New-QADUser -parentcontainer 'domain.local/test' -connection $testDomain

On the new account, the only thing copied across is the CN. None of the other attributes - samAccountName, FirstName, exchange attributes etc, have come across. What am I doing wrong?

share|improve this question
up vote 1 down vote accepted

Unfortunately you need to specify each value you want copied across at the moment. New-QADUser does not accept parameter values by pipeline input right now. If you would like this support to be added, please request it on the PowerGUI forums ( I already requested this feature, however I work at Quest so they won't necessarily listen to me! :)

In the meantime, to copy a user you'll have to do something like this:

$me = Get-QADUser myAccount -IncludeAllProperties -connection $prodDomain
New-QADUser -Name $me.Name -SamAccountName $me.SamAccountName -Title $me.Title -Department $me.Department ... -ParentContainer 'domain.local/test' -Connection $testDomain

(the ellipsis was added to save should fill in the blank with the attributes you want to copy over).

share|improve this answer

Have you looked at what $me returns? it might be that whatever $me is, it may not be what New-QADUser was expecting

Worst case is you may need to break out the values of $me into an @array{}, and then populate using the -ObjectAttributes Parameter for New-QADUser. I can't actually test this right now, so have been using this wiki info:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.