我所在的部门大概管理了300+台Windows终端,最近开始采用域的方式来进行管理。(别笑我们土,原来手工修改Windows口令太痛苦了。)

现在的任务是想在域控服务器中列出纳入域管理的所有机器,以及最近登陆的时间。

可以通过PowerShell来进行查询。

Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap –Auto

Import-Module ActiveDirectory
Get-ADComputer -Filter {enabled -eq $true} -properties *|select Name, DNSHostName, OperatingSystem, LastLogonDate

get-adcomputer -filter {enabled -eq $true} -properties * | ft name, dnshostname, operating system, @{n=‘lastlogontimestamp’;e={[DateTime]::FromFileTime($_.Lastlogontimestamp)}}


查询的结果是这样的。
列出Windows域中所有的机器

参考资料:
1、How to get all active computer list in domain with some attributes?
2、Active Directory Reference Sheet
3、Oldcmp工具

相关文章:

  • 2021-09-14
  • 2022-01-05
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-09-25
猜你喜欢
  • 2022-12-23
  • 2021-12-25
  • 2021-06-26
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
相关资源
相似解决方案