Powershell 5中的终端服务器配置文件脚本已损坏
多年来,我一直使用以下方法通过powershell设置和获取终端服务器配置文件: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,这将不再有效,并产生以下错误:
$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脚本再次工作。