我们是否需要Active Directory域控制器来运行任何PowerShell命令?

发布于 2025-01-28 10:24:34 字数 487 浏览 3 评论 0 原文

我正在尝试运行一个调用 Get-Aduser 命令的PowerShell脚本。
类似于这个问题的东西
但是我会得到错误 Get-Aduser:无法找到使用Active Directory Web服务运行的默认服务器。

我已导入ActivedIrecotry模块,并且还运行了连接 - azuread命令。

是否必须让AD域控制器运行PowerShell命令?
我们可以像使用Active Directory Admin的凭据一样运行PowerShell命令,例如 Get-Aduser

I am trying to run a Powershell script which calls Get-ADUser command.
Something similar to this question Powershell Active Directory commands not working in Powershell session
But I am getting error Get-ADUser : Unable to find a default server with Active Directory Web Services running.

I have Imported the ActiveDirecotry Module and also run the Connect-AzureAD command.

Is it must to have the AD domain controller for running the Powershell commands?
Can we run Powershell commands like Get-ADUser just using the credentials of the Active Directory Admin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巾帼英雄 2025-02-04 10:24:34

是的。 ActiveIverectory 使用 rsat工具安装的模块CMDLET 需要与Active Directory基础架构进行通信,以检索有关该域和存储在其中的对象的信息。

通常(如果不是完全)涵盖了其他第一方Powershell模块,这些模块还与Adds之外的Active Directory Services集成在一起;服务需要传达给PowerShell模块才能正确运行的服务。


但是,您对Active Directory和Azure AD之间的差异有根本的误解。它们是独立的服务,并且不以相同的方式运行。高级别:

  • Active Directory 是Microsoft提供的自托管本地目录服务解决方案。这是您自1999年以来所认识和喜欢的全功能广告。

    通常使用 rsat工具功能和 activeiveRectory PowerShell模块安装。

  • Azure AD 是Azure中Microsoft提供的完全独立的托管目录服务。它无法提供接近1:1特征奇偶校验的任何地方,具有本地 Active Directory 。这并不是说这是一个小产品;它只是不同的产品。

    值得一提的是, azure ad 有一些方便的功能您不会使用本地 Active Directory 。通常通过Azure门户或 az。* PowerShell模块可从PowerShell Gallery提供。

您不能使用 ActiveIverectory 模块来管理 Azure Ad ,就像您无法使用 az一样。目录。当然,您可以在单个系统上安装两个模块,您只需要使用正确的服务使用正确的模块即可。

Yes. The ActiveDirectory module cmdlets installed with RSAT Tools need to communicate with Active Directory infrastructure to retrieve information about the domain and objects stored within it.

This generally (if not wholly) encompasses other first-party PowerShell modules integrating with Active Directory services outside of ADDS as well; the services need to be communicable for the PowerShell modules to function correctly.


However, you have a fundamental misunderstanding of the differences between Active Directory and Azure AD. They are separate services and do not function the same way. At a high level:

  • Active Directory is the self-hosted on-prem directory services solution provided by Microsoft. This is the fully-functional AD you have known and loved since 1999.

    Generally administered with the RSAT Tools feature and the ActiveDirectory PowerShell module it installs.

  • Azure AD is a completely separate managed-directory service available from Microsoft in Azure. It does not provide anywhere close to a 1:1 feature parity with on-prem Active Directory. That isn't to say it is a lesser product; it is simply a different product.

    It is worth a mention that there are handy features available with Azure AD that you don't get with on-prem Active Directory. Generally administered via the Azure Portal, or the Az.* PowerShell modules available from the PowerShell Gallery.

You cannot use the ActiveDirectory module to manage Azure AD just as you cannot use the Az.* modules to manage on-prem Active Directory. You can have both modules installed on a single system of course, you just need to use the correct module with the correct service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文