加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows-server-2008 – 缺少Get-ADComputer OperatingSystem属

发布时间:2020-12-13 23:52:14 所属栏目:Windows 来源:网络整理
导读:虽然所有在线文档和示例都说Get-ADComputer的结果应该有一个OperatingSystem属性,但我的Win Server 2008 R2上没有. 以下是我在Get-ADComputer上的所有内容: PS I: Get-ADComputer -filter{name -eq "sit-selpa"} | Get-Member TypeName: Microsoft.ActiveD
虽然所有在线文档和示例都说Get-ADComputer的结果应该有一个OperatingSystem属性,但我的Win Server 2008 R2上没有.

以下是我在Get-ADComputer上的所有内容:

PS I:&; Get-ADComputer -filter{name -eq "sit-selpa"} | Get-Member


   TypeName: Microsoft.ActiveDirectory.Management.ADComputer

Name              MemberType            Definition
----              ----------            ----------
Contains          Method                bool Contains(string propertyName)
Equals            Method                bool Equals(System.Object obj)
GetEnumerator     Method                System.Collections.IDictionaryEnumer...
GetHashCode       Method                int GetHashCode()
GetType           Method                type GetType()
ToString          Method                string ToString()
Item              ParameterizedProperty Microsoft.ActiveDirectory.Management...
DistinguishedName Property              System.String DistinguishedName {get...
DNSHostName       Property              System.String DNSHostName {get;set;}
Enabled           Property              System.Boolean Enabled {get;set;}
Name              Property              System.String Name {get;}
ObjectClass       Property              System.String ObjectClass {get;set;}
ObjectGUID        Property              System.Nullable`1[[System.Guid,msco...
SamAccountName    Property              System.String SamAccountName {get;set;}
SID               Property              System.Security.Principal.SecurityId...
UserPrincipalName Property              System.String UserPrincipalName {get...

sit-selpa是我正在运行它的本地主机的Server 2008 R2服务器.

为什么只有9个房产?我在网上搜索过,但我似乎无法找到有这种经历的人.

您的Get-AdComputer仅使用对象的默认属性.使用-Properties *将它们全部抓取:
Get-ADComputer -filter {name -eq "sit-selpa"} -Property * | Get-Member

然后,只需获取OperatingSystem:

Get-ADComputer -filter {name -eq "sit-selpa"} -Property * | Select-Object OperatingSystem

但是,您不需要使用通配符获取所有对象属性.您可以显式指定其他属性:

Get-ADComputer -Identity sit-selpa -Properties OperatingSystem
...
Get-ADComputer -Identity sit-selpa -Properties OperatingSystem,OperatingSystemVersion

(编辑:李大同)

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

    推荐文章
      热点阅读