如何在域控制器上查找现有或移出的机器?

我将850台现有机器从Forest A的2003 Active Directory Server迁移到Server 2012 R2的Forest B。 基本上改变每台机器的域名,并join到一个新的域名。

我怎样才能找出是否有任何机器仍旧在旧的域名上,或哪些机器没有移出?

我不确定Server 2003中的PowerShell有什么限制,但是可以使用以下命令列出给定域中的所有PC。

ps> Import-Module ActiveDirectory ps> Get-ADComputer -Filter "Enabled -eq '$true'" | Select Name This command will give you a quick count of active PCs: ps> (Get-ADComputer -Filter "Enabled -eq '$true'").Count This command will give you a quick count of inactive PCs(PCs that have been moved): ps> (Get-ADComputer -Filter "Enabled -eq '$false'").Count 

http://blogs.technet.com/b/askds/archive/2010/02/04/inventorying-computers-with-ad-powershell.aspx

http://newdelhipowershellusergroup.blogspot.com/2012/06/powershell-and-active-directory-find.html

如果失败了,只需使用Active Directorypipe理单元并查看“计算机”节点就足以查看每个域中有多less个已启用的PC。 当您更改域名时,PC将自动在旧域中禁用。

您可以通过@ jscott的评论来回答这个问题,这个评论是关于已经禁用了计算机帐户的未绑定的计算机,以及这个dsquery命令:

列出OU中所有已启用的计算机帐户:

 dsquery computer OU=Test,DC=example,DC=com -limit 5000|dsget computer -dn -disabled | find /i " no"