WSH ADSI WinNT获取用户属性

时间:2019-01-04 10:16:45

标签: vbscript wsh adsi

我想在工作组环境中的WS2012r2上读取本地用户帐户的Network Access Permission属性值(“本地用户和组”►“属性”►“拨入”选项卡)。

我运行脚本:

On Error Resume Next
Set usr = GetObject("WinNT://<Workgroup_name>/<computer_name>/<user_name>,user")

WScript.Echo "Parameters " & usr.Parameters
WScript.Echo "RasPermissions " & usr.RasPermissions
WScript.Echo "DialinPrivilege " & usr.DialinPrivilege
WScript.Echo "msNPAllowDialin " & usr.msNPAllowDialin

WScript.Echo "MaxDisconnectionTime " & usr.MaxDisconnectionTime

仅获得:

Parameters m                     d                              P♣▲∟☺msNPAllowDi
alin?????????????☺CtxCfgPresent????☺CtxCfgFlags1????☺CtxShadow????*☻☺CtxMinEncry
ptionLevel?
MaxDisconnectionTime 60

-只是在参数字符串值中提到的msNPAllowDialin,但格式不可读。

我该怎么做?

0 个答案:

没有答案