Get-ADUser整个林 [英] Get-ADUser entire forest

查看:146
本文介绍了Get-ADUser整个林的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这是以前已经回答过的问题,但是我已经搜索了几天,却找不到类似于我正在寻找的东西(这令人困惑,因为这似乎是最简单的请求)。

Sorry if this is something that has been answered before but I've been searching for days and cannot find anything like what I'm looking for (which is baffling because it seems like the simplest request).

我有一个跟踪委托树的脚本(不相关),并且在其中,我需要能够针对整个目录可靠地为特定用户执行Get-ADUser,但我没有找到一种无需100行代码即可完成此操作的方法。我们的林中有四个域:

na.ds.company.com

la.ds.company.com

ea.ds。 company.com

ap.ds.company.com

I have a script that traces a delegate tree (irrelevant) and within it, I need to be able to reliably execute Get-ADUser for a specific user against the entire directory and I have not found a way to do this yet that doesn't involve 100 lines of code. We have four domains in our forest:
na.ds.company.com
la.ds.company.com
ea.ds.company.com
ap.ds.company.com

为什么在ADUC中如此简单而在Powershell中却如此困难?

Why is this so simple to do in ADUC and so hard to do in Powershell?

推荐答案

我通过引用根目录中的GC域控制器和该DC上的GC端口来修复它(3268)。我以前尝试过此方法,但我认为问题是我尝试使用的GC不在根目录中。该命令最终为:

I fixed it by referencing a GC domain controller in the root directory and the GC port on that DC (3268). I tried this before but I think the problem was that the GC I tried was not located in the root. The command ended up being:

Get-ADUser <userID> -Server <GC located in root>:3268

这篇关于Get-ADUser整个林的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆