title: Terminal Server profiles script broken in Powershell 5
body: <p>I have been using the following to set and get terminal server profiles through powershell for years:</p>
  
  <pre><code>$user = [ADSI]"LDAP://$dn"
  $user.psbase.InvokeGet("terminalservicesprofilepath")
  $user.psbase.InvokeSet("terminalservicesprofilepath",'\\server\share\user')
  </code></pre>
  
  <p>Since upgrading to <code>windows 10</code> and thus <code>Powershell 5</code> this no longer works and produces the following error:</p>
  
  <pre><code> Exception calling "InvokeGet" with "1" argument(s): "Unknown name. (Exception from HRESULT: 0x80020006 
  (DISP_E_UNKNOWNNAME))" At line:1 char:1 + ldap.psbase.invokeget("terminalservicesprofilepath")
   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
   + FullyQualifiedErrorId : DotNetMethodException
  </code></pre>
  
  <p>It seems as if MS have removed these properties, anyone found a way around this?</p>