下面对一些AD用户TS主目录的查询将导致一个DotNetException。我的密码怎么了?这个例外想告诉我的是什么?
$userObject = Get-ADUser someUser -Properties *
$userObject.userParameters
$adsiObject = [adsi]"LDAP://$($userObject.DistinguishedName)"
$adsiObject.PSBase.InvokeGet("TerminalServicesHomeDirectory"); 输出:
PCtxCfgPresent㔵攱戰ぢCtxCfgFlags1〰て〲〹CtxCallback〰〰〰〰CtxShadow㌰〰〰〰(CtxMaxConnectionTime〰〰〰〰.CtxMaxDisconnectionTime〰〰〰〰CtxMaxIdleTime〰〰〰〰"CtxKeyboardLayout〰〰〰〰*CtxMinEncryptionLevel
CtxWorkDirectory〰 CtxNWLogonServer〰CtxWFHomeDir〰"CtxWFHomeDirDrive〰 CtxWFProfilePath〰"CtxInitialProgram〰"CtxCallbackNumber〰
Exception calling "InvokeGet" with "1" argument(s): "Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"
At D:\SourceCode\PowerShell\Get-ADTSProperties.ps1:125 char:1
+ $adsiObject.PSBase.InvokeGet("TerminalServicesHomeDirectory");
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException所以属性userParameters在那里,并保存数据。
发布于 2015-07-03 12:19:37
我自己想出来的。库tsuserex.dll没有注册,它提供导出以读取userParameters BLOB。
如何从AD ( msTSHomeDrive )中读取msTSHomeDrive和msTSHomeDirectory属性(VB.NET)
https://stackoverflow.com/questions/31206225
复制相似问题