检索本地服务器用户的环境启动程序?
我正在使用 vbscript 来检索本地用户帐户详细信息。此脚本使用 Win32_Account 。
该脚本的摘录:
If (bWMILocalAccounts) Then
ReportProgress " Gathering local users"
Set colItems = objWMIService.ExecQuery("Select Description, Name, FullName, LocalAccount from Win32_UserAccount Where Domain='" & strComputerSystem_Name & "'",,48)
Set objDbrLocalAccounts = CreateObject("ADOR.Recordset")
objDbrLocalAccounts.Fields.Append "Description", adVarChar, MaxCharacters
objDbrLocalAccounts.Fields.Append "UserName", adVarChar, MaxCharacters
是否可以阅读“环境 ->”启动程序的路径?
I am using a vbscript to retrieve local user account details. This script uses the Win32_Account .
An excerpt from that script:
If (bWMILocalAccounts) Then
ReportProgress " Gathering local users"
Set colItems = objWMIService.ExecQuery("Select Description, Name, FullName, LocalAccount from Win32_UserAccount Where Domain='" & strComputerSystem_Name & "'",,48)
Set objDbrLocalAccounts = CreateObject("ADOR.Recordset")
objDbrLocalAccounts.Fields.Append "Description", adVarChar, MaxCharacters
objDbrLocalAccounts.Fields.Append "UserName", adVarChar, MaxCharacters
Is it possible to read the 'Environment -> Starting Program' path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的信息来自 ADSI,所以我搜索了一下并找到了这个 链接。它提供了一个很好的表格,显示“Active Directory 用户和计算机”选项卡中的哪些字段与其在脚本(批处理、vbs 等)中使用的属性相匹配。
有了这些信息,activexperts.com 提供了一个很棒的 VBScript 示例 显示此信息(如此处复制的),您可以将其添加到脚本中。
The info you're looking for is coming from ADSI, so I searched a bit and found this link on virtualizationadmin.com. It provides a nice table showing which fields in the Active Directory Users and Computers tab match their attribute for use in a script (batch, vbs, etc.).
With that info in hand, activexperts.com gives a great sample VBScript to display this info, as copied here, which you can work into your script.