PowerShell cmdlet Set-ADComputer 和 Get-ADComputer 是否在 OU=COMPUTER 之外工作?

Do the PowerShell cmdlets Set-ADComputer and Get-ADComputer work outside of OU=COMPUTER?

我想知道 Set-ADComputerGet-ADComputer 是否仅适用于 OU=Computer 中存在的对象,或者这些 cmdlet 是否与任何其他位置兼容?

这些 cmdlet 在整个 AD 中都有效! 您可以使用参数 -identity:

指定单台计算机

The Identity parameter specifies the Active Directory computer to modify. You can identify a computer by its distinguished name, GUID, security identifier (SID) or Security Accounts Manager (SAM) account name. You can also set the Identity parameter to an object variable such as $, or you can pass an object through the pipeline to the Identity parameter. For example, you can use the Get-ADComputer cmdlet to retrieve a computer object and then pass the object through the pipeline to Set-ADComputer.

或者您可以使用参数 -filter 在整个 AD 中根据特定条件进行过滤,或者使用参数 -SearchBase 指定 OU。

更多详细信息:

https://docs.microsoft.com/en-us/powershell/module/addsadministration/set-adcomputer?view=win10-ps

https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adcomputer?view=win10-ps