加入收藏 | 设为首页 | 会员中心 | 我要投稿 济源站长网 (https://www.0391zz.cn/)- 数据工具、数据仓库、行业智能、CDN、运营!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

如何通过Powershell编辑Active-Directory站点属性?

发布时间:2021-01-20 19:23:54 所属栏目:Windows 来源:网络整理
导读:我无法通过Power shell访问Active-Directory网站的位置属性. ( Windows Server 2012 R2) 以下命令不返回任何值: (Get-ADReplicationSite“Default-First-Site-Name”| Get-ADObject).location 此命令返回一个标识符: (Get-ADReplicationSite“Default-Firs

我无法通过Power shell访问Active-Directory网站的位置属性. ( Windows Server 2012 R2)

以下命令不返回任何值:
> (Get-ADReplicationSite“Default-First-Site-Name”| Get-ADObject).location

此命令返回一个标识符:
> (Get-ADReplicationSite“Default-First-Site-Name”| Get-ADObject).objectGUID

当我查看Active Directory站点和服务管理单元中对象的图形属性编辑器时,我可以通过objectGUID-propterty验证我确实查询了正确的AD对象并且填充了location-property.

那么为什么Powershell没有返回值,我如何查询和编辑位置属性?

因为 Get-ADObject does not retrieve all attributes默认:

The Get-ADObject cmdlet returns a default set of ADObject property values. To retrieve additional ADObject properties,use the Properties parameter of the cmdlet.

objectGUID属性具有值,因为它是the default property set的一部分

您可以使用-Properties参数指定要检索的Get-ADObject的其他属性:

(Get-ADReplicationSite "Default-First-Site-Name" | Get-ADObject -Properties location).location

(编辑:济源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读