Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 5中的终端服务器配置文件脚本已损坏_Powershell_Active Directory - Fatal编程技术网

Powershell 5中的终端服务器配置文件脚本已损坏

Powershell 5中的终端服务器配置文件脚本已损坏,powershell,active-directory,Powershell,Active Directory,多年来,我一直使用以下方法通过powershell设置和获取终端服务器配置文件: $user = [ADSI]"LDAP://$dn" $user.psbase.InvokeGet("terminalservicesprofilepath") $user.psbase.InvokeSet("terminalservicesprofilepath",'\\server\share\user') 由于升级到windows 10,从而升级到Powershell 5,这将不再有效,并产生以下错误:

多年来,我一直使用以下方法通过powershell设置和获取终端服务器配置文件:

$user = [ADSI]"LDAP://$dn"
$user.psbase.InvokeGet("terminalservicesprofilepath")
$user.psbase.InvokeSet("terminalservicesprofilepath",'\\server\share\user')
由于升级到
windows 10
,从而升级到
Powershell 5
,这将不再有效,并产生以下错误:

 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

似乎MS已经删除了这些属性,有人找到了解决方法吗?

我注意到Windows 10中的ADUC管理单元中不再存在远程桌面选项卡。似乎这可能是“出于设计”我已经找到了一个解决方法,如果您将tsuserex.dll和tsuserex.dll.mui从Windows Server 2012 R2计算机复制到Windows 10计算机上的正确位置并注册它们,您就可以在ADUC中看到RDS选项卡,powershell脚本再次工作。