简体   繁体   English

在Active Directory中如何获取用户的计算机名称

[英]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.

相关问题 Powershell:如何从 Azure Active Directory 用户获取名称 (Get-AzADUser) - Powershell: How do I get the name from Azure Active Directory user (Get-AzADUser) 我需要一个脚本来检测计算机是否在活动目录用户组中 - I need a script to detect if a computer is in an active directory user group 如何通过 Powershell 删除 Active Directory 中的用户? - How do I delete user in Active Directory through Powershell? 如何列出 Active Directory 计算机对象上“已验证写入服务主体名称”和“写入服务主体名称”的权限 - How to I list the permissions on Active Directory Computer Object for "Validated write to service principal name" and "write service principal name" PowerShell 中的正则表达式从 Active Directory 中的 Managedby 属性获取用户名 - Regex in PowerShell to get user's name from Managedby property in Active Directory 我如何获得 AD 计算机的名称租户和描述 - How do i get AD computer's names tenant and description Active Directory用户名约定? - Active Directory User Name Convention? 如何在客户端计算机上不安装 RSAT 工具的情况下通过 powershell 查询域用户的 Active Directory - How to query Active Directory for a domain user via powershell without installing RSAT tools on client computer Powershell不会从Active Directory中提取所有计算机名称 - Powershell won't pull every computer name from Active Directory Powershell:在Active Directory中查找第一个免费计算机名称 - Powershell : Find the first free computer name in Active Directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM