title: Set-ADObject error in PowerShell
body: <p>I created a script to copy an existing user when a new one starts.</p>
  
  <p>I went on leave for 2 weeks, come back and its not working - and no-ones touched the script</p>
  
  <pre><code>Get-ADUser -LDAPFilter "(UserPrincipalName=copy_me@test.com)" -Properties Description, physicalDeliveryOfficeName, StreetAddress, PostOfficeBox, State, st, l, PostalCode, co, c, Pager, Department, Company, Manager, MemberOf | ForEach-Object {Set-ADObject -Identity "CN=New User,OU=Our-Users,DC=Test,DC=Com" -Replace @{Description="$($_.Description)";physicalDeliveryOfficeName="$($_.physicalDeliveryOfficeName)"; StreetAddress="$($_.StreetAddress)"; PostOfficeBox="$($_.PostOfficeBox)"; st="$($_.st)"; l="$($_.l)"; PostalCode="$($_.PostalCode)"; co="$($_.co)"; c="$($_.c)"; Pager="$($_.Pager)"; Department="$($_.Department)"; Company="$($_.Company)"; Manager="$($_.Manager)"; OtherTelephone=" 8823"}} 
  </code></pre>
  
  <p>The error powershell shows is:</p>
  
  <pre><code>    Set-ADObject : replace
  At C:\Windows\System32\WindowsPowerShell\v1.0\user-process\copy-user.ps1:2 char:271
  + Get-ADUser -LDAPFilter "(UserPrincipalName=copy_me@test.com)"
   -Properties Description, physicalDeliveryOfficeName, StreetAddress, PostOffice
  Box, State, st, l, PostalCode, co, c, Pager, Department, Company, Manager, Memb
  erOf | ForEach-Object {Set-ADObject &lt;&lt;&lt;&lt;  -Identity "cn=New User,ou=our-users,dc=test,dc=com" -Replace @{Description="$($_.D
  escription)";physicalDeliveryOfficeName="$($_.physicalDeliveryOfficeName)"; Str
  eetAddress="$($_.StreetAddress)"; PostOfficeBox="$($_.PostOfficeBox)"; st="$($_
  .st)"; l="$($_.l)"; PostalCode="$($_.PostalCode)"; co="$($_.co)"; c="$($_.c)";
  Pager="$($_.Pager)"; Department="$($_.Department)"; Company="$($_.Company)"; Ma
  nager="$($_.Manager)"; OtherTelephone=" 8823"}}
      + CategoryInfo          : InvalidOperation: (cn=Test User...,dc=test,d
     c=com:ADObject) [Set-ADObject], ADInvalidOperationException
      + FullyQualifiedErrorId : replace,Microsoft.ActiveDirectory.Management.Com
     mands.SetADObject
  </code></pre>