windows – 上次知道的计算机登录
发布时间:2020-12-13 23:15:04 所属栏目:Windows 来源:网络整理
导读:我一直在使用以下命令输出为退役设置的计算机列表的最后一次已知登录.该脚本可以工作,但仅适用于当前登录的DC.如何让它循环遍历网络中的所有DC. Get-ContentC:noresponse.csv|Foreach-Object{Get-ADComputer$_-PropertiesLastLogonDate}|SortLastLogonDate|
我一直在使用以下命令输出为退役设置的计算机列表的最后一次已知登录.该脚本可以工作,但仅适用于当前登录的DC.如何让它循环遍历网络中的所有DC.
根据您现有的PS,您需要一些东西来帮助确定AD中的旧计算机.
你可以运行PS here: # Gets time stamps for all computers in the domain that have NOT logged in since after specified date # Mod by Tilo 2013-08-27 import-module activedirectory $domain = "domain.mydom.com" $DaysInactive = 90 $time = (Get-Date).Adddays(-($DaysInactive)) # Get all AD computers with lastLogonTimestamp less than our time Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -Properties LastLogonTimeStamp | # Output hostname and lastLogonTimestamp into CSV select-object Name,@{Name="Stamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}} | export-csv OLD_Computer.csv -notypeinformation 或者我个人长期以来最喜欢的JoeWare: http://www.joeware.net/freetools/tools/oldcmp/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2008 – 修改Active Directory连接对象
- active-directory – Active Directory写入权限允许编辑用户
- windows 常用命令
- active-directory – U2F(YubiKey等)和Active Directory
- windows-server-2008-r2 – 如何在Windows Server 2008 R2
- windows-ce – 如何为Windows CE创建应用程序
- win10安装tensorflow
- windows – 如何在批处理文件中睡觉?
- wpf – 使用WiX在应用程序的主要升级中从Windows 7任务栏中
- 如何在Windows上用Java读/写串口?
推荐文章
站长推荐
热点阅读