# Why is -property \* needed?

**URL:** <https://forums.powershell.org/t/why-is-property-needed/1670>\
**Category:** PowerShell Help\
**Created:** [June 10, 2013, 1:38am UTC](https://forums.powershell.org/t/why-is-property-needed/1670 "2013-06-10T01:38:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew-plunkett](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@matthew-plunkett](https://forums.powershell.org/u/matthew-plunkett)\
**Post date:** [June 10, 2013, 1:38am UTC](https://forums.powershell.org/t/why-is-property-needed/1670/1 "2013-06-10T01:38:23Z")

</div>

Contrast the two statements below.Â The behavior is odd to me.Â If both things are of type Microsoft.ActiveDirectory.Management.ADGroup, then why is it necessary to specify -property \* (or just whatever extended property you’re looking for) in order to have that field whenÂ referring to an object returned by get-adgroup?Â I had thought when you selected or sorted by certain properties, that all you were doing was deciding what was output to the screen or filtered or whatever, but it appears that that data is simply not present unless you specify that you want it.Â Does that mean that what’s returned is not really of the type specified?Â Or it’s a copy with the nonselected properties set to $null or similar?

get-adgroup “\<group name\>” | gm  
Â Â TypeName: Microsoft.ActiveDirectory.Management.ADGroup

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…  
GroupCategoryÂ Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.Nullable`1[[Microsoft.ActiveD... GroupScopeÂ Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.Nullable`1[[Microsoft.ActiveD…  
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…

H$ get-adgroup “\<group name\>” -property \* | gm  
Â Â TypeName: Microsoft.ActiveDirectory.Management.ADGroup

NameÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MemberTypeÂ Â Â Â Â Â Â Â Â Â Â Definition  
----Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ----------Â Â Â Â Â Â Â Â Â Â Â ----------  
ContainsÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â bool Contains(string p…  
EqualsÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â bool Equals(System.Obj…  
GetEnumeratorÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â System.Collections.IDi…  
GetHashCodeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â int GetHashCode()  
GetTypeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â type GetType()  
ToStringÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â MethodÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â string ToString()  
ItemÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ParameterizedProperty Microsoft.ActiveDirect…  
CanonicalNameÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.String Canonica…  
CNÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.String CN {get;}  
CreatedÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.DateTime Create…  
createTimeStampÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.DateTime create…  
DeletedÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.Boolean Deleted…  
DescriptionÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.String Descript…  
DisplayNameÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.String DisplayN…  
DistinguishedNameÂ Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.String Distingu…  
dSCorePropagationDataÂ Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â Microsoft.ActiveDirect…  
GroupCategoryÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PropertyÂ Â Â Â Â Â Â Â Â Â Â Â Â System.Nullable`1[[Mic…

\<snip many more fields, including memberof, which I was interested in\>

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [June 10, 2013, 1:58am UTC](https://forums.powershell.org/t/why-is-property-needed/1670/2 "2013-06-10T01:58:45Z")

</div>

It’s a performance thing - same reason you have to specify -filter. The DC by default returns a subset of properties just to make its own life easier. So if you want more than that, you use -Prop. You can useÂ **-Prop \*** to get everything, or specify a list of properties if you want less than everything.

---

<div class="post-metadata">

**Author:** ![matthew-plunkett](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@matthew-plunkett](https://forums.powershell.org/u/matthew-plunkett)\
**Post date:** [June 10, 2013, 3:20am UTC](https://forums.powershell.org/t/why-is-property-needed/1670/3 "2013-06-10T03:20:51Z")

</div>

Thanks, that’s interesting.Â I hadn’t thought about it having to go to the DC for the information.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:57pm UTC](https://forums.powershell.org/t/why-is-property-needed/1670/4 "2024-05-16T20:57:47Z")

</div>


