I have been using the following to set and get terminal server profiles through powershell for years:
$user = [ADSI]"LDAP://$dn"
$user.psbase.InvokeGet("terminalservicesprofilepath")
$user.psbase.InvokeSet("terminalservicesprofilepath",'\\server\share\user')
Since upgrading to windows 10
and thus Powershell 5
this no longer works and produces the following error:
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
It seems as if MS have removed these properties, anyone found a way around this?
User contributions licensed under CC BY-SA 3.0