[英]In Active Directory how do I get the user's computer name
Using Powershell, I can get a separate list of all users or all computer on the domain but how can combine both? 使用Powershell,我可以得到域中所有用户或所有计算机的单独列表,但是如何将两者结合起来? With powershell you can search for users or computers with the following
使用powershell,您可以使用以下内容搜索用户或计算机
$search= New-Object DirectoryServices.DirectorySearcher([ADSI]"")
search.Filter = "(&(objectCategory=person)(objectClass=user))"#result=users
OR 要么
$search= New-Object DirectoryServices.DirectorySearcher([ADSI]"")
search.Filter = "("(objectCategory='computers')")"#result=computers
How can I combine the two, so i may know what computer a user is assign to? 如何将两者结合起来,这样我才能知道用户分配给哪台计算机?
You can't get that from Active Directory. 您无法从Active Directory中获得该信息。
Active directory doesn't record which workstation a user logged on from, and unless the user's logonworkstation attribute has been set to limit where they can log on, there's nothing to prevent them from logging on to any and all workstations in the domain. Active Directory不会记录用户从哪个工作站登录,并且除非已将用户的logonworkstation属性设置为限制他们可以登录的位置,否则没有什么可以阻止他们登录到域中的所有工作站。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.