PowerShell:Get成员未显示所有可用属性
为什么get成员不显示所有可用的成员?例如PowerShell:Get成员未显示所有可用属性,powershell,active-directory,Powershell,Active Directory,为什么get成员不显示所有可用的成员?例如 PS > get-aduser john.doe | get-member -MemberType All -View All TypeName: Microsoft.ActiveDirectory.Management.ADUser Name MemberType Definition ---- ---------- ----------
PS > get-aduser john.doe | get-member -MemberType All -View All
TypeName: Microsoft.ActiveDirectory.Management.ADUser
Name MemberType Definition
---- ---------- ----------
Contains Method bool Contains(string propertyName)
Equals Method bool Equals(System.Object obj)
GetEnumerator Method System.Collections.IDictionaryEnumerator GetEnumerator()
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Item ParameterizedProperty Microsoft.ActiveDirectory.Management.ADPropertyValueCollection Item(string p...
DistinguishedName Property System.String DistinguishedName {get;set;}
Enabled Property System.Boolean Enabled {get;set;}
GivenName Property System.String GivenName {get;set;}
Name Property System.String Name {get;}
ObjectClass Property System.String ObjectClass {get;set;}
ObjectGUID Property System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, ...
SamAccountName Property System.String SamAccountName {get;set;}
SID Property System.Security.Principal.SecurityIdentifier SID {get;set;}
Surname Property System.String Surname {get;set;}
UserPrincipalName Property System.String UserPrincipalName {get;set;}
PS > get-aduser john.doe -Properties ScriptPath
DistinguishedName : [...],DC=ad,DC=nutex,DC=com
Enabled : True
GivenName : John
Name : john.doe
ObjectClass : user
ObjectGUID : [...]
SamAccountName : john.doe
ScriptPath : LogonScript.vbs
SID : [...]
Surname : Doe
UserPrincipalName : john.doe@nutex.com
如您所见,属性ScriptPath未作为成员列出。然而,信息是存在的。。。。我错过了什么?提前谢谢 每个PowerShell Active Directory模块cmdlet(如Get-ADUser和Get-ADComputer)都会显示检索到的所有对象的默认属性集。可以使用-properties参数指定其他属性,但默认设置将始终包含在内。可以指定另一组扩展属性。此外,通过在-Properties参数中指定属性的LDAPDisplayName,可以包括适合对象类的任何Active Directory属性 您可以在technet中找到更多详细信息: 如果您的问题是如何知道用户(user类中的对象)可以拥有的所有属性,那么我认为Active Directory架构包含这些信息。要显示可在对象上检索的所有属性,请使用:
get-aduser john.doe -Properties *
“此cmdlet检索一组默认的用户对象属性。若要检索其他属性,请使用properties参数。有关如何确定用户对象属性的详细信息,请参阅properties参数说明。”
Get-aduser username-properties*