title: Is it possible to set a users memberOf property in Active Directory using Powershell
body: <p>I need to create a Powershell script that sets some user attributes in Active Directory.</p>
  
  <p>I'm using the Set-AdUser command and passing in a user object as follows:</p>
  
  <pre><code>$user = Get-AdUser -Identity $userIdentity
  $user.MemberOf = $dn_of_group
  Set-ADUser -Instance $user
  </code></pre>
  
  <p>this returns an error of 'The adapter cannot set the value of property "MemberOf"'.</p>
  
  <p>Is it possible to set the MemberOf property from powershell?</p>
  
  <p>If so, what am I doing wrong?</p>