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?
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:
http://wiki.powergui.org/index.php/New-QADUser
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 (http://powergui.org). 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:
(the ellipsis was added to save time...you should fill in the blank with the attributes you want to copy over).