【问题标题】:Get computers list from certain OU in active directory?从活动目录中的某个 OU 获取计算机列表?
【发布时间】:2013-08-22 21:40:27
【问题描述】:

我正在使用下面的 powershell 命令来获取过去 60 天内未登录的计算机的列表。这将返回所有 OU 计算机。是否可以将下面的行更改为从某个OU返回?

Get-ADComputer -Property Name,lastLogonDate -Filter {lastLogonDate -lt $then} | FT Name,lastLogonDate

【问题讨论】:

    标签: powershell active-directory


    【解决方案1】:

    从在线help 页面尝试使用 -SearchBase 过滤器

    C:\PS>Get-ADComputer -LDAPFilter "(name=*laptop*)" -SearchBase "CN=Computers,DC=Fabrikam,DC=com"
    

    【讨论】:

      猜你喜欢
      • 2011-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-09
      • 1970-01-01
      • 2015-02-07
      相关资源
      最近更新 更多