我想改变我们的AD用户(Windows XP / vista / 7机器和一些服务器)的logon.bat脚本,以便它根据一些AD信息在login时写入一个环境variables,例如“用户是什么组”。
基本上: SET MyADGroup=<some magic query/command that can get that AD information here>
一些谷歌search让我进入dsget等,但这只是在服务器上,并没有内置到任何“普通客户端”。
我认为使用GPP会更容易:
您可以使用“NET USER”命令获取用户所属组的列表:
net user <username> /domain
该命令提供了大量信息,包括组成员身份; 但是将其存储在variables中可能会变得棘手,因为您需要parsing命令的输出。