properties - Powershell Get property 2 levels down -
How it's going to flackoverstow,
I'm new to powershell and the properties seem to be re There is a problem obtaining two levels below the source (aka: I can get the property property like $ foo.bar, but said property is not property such as $ foo.bar.soap)
I have $ Code = Which of the following output is below Is: If the code works like I wanted to do this , "Reputable name" or something should have been printed between the bottom lines How can I get $ topLevel.Fields.Name? Firstly, let me indicate that when you can use PowerShell on the COM object,
Properties: System .__ com object AbsolutePosition: 2 ActiveConnection: System .__ ComObject BOF: Wrong Bookmark: 1 CacheSize: 1 CursorType: 3 EOF: Wrong Fields: System .__ ComObject LockType: 1 MaxRecords: 0 RecordCount: 932 Source: & lt; LDAP: //company.com>;; (ObjectCategory = group); Famous name; Subdivision Full Page: 1 editing mode: 0 Filter: 0 Pejkount: 94 Pejasistm: 10 Sort: Status: State 0: 1 cursor location: 2 Marshall options: 0 Data source: System .__ com object activated Command System .__ com Object StayInSync: Correct Datamember: Index: ----------------- - Properties: System .__ ComObject ActualSize: 234 Properties: 32 DefinedSize: 4000 Name: distinguishedName type : 202 Price: CN = empty, OU = empty, OU = empty group, DC = company, DC = com Precision: 255 points: 255 original price: int Value Value: Data Format: Status: 0 ----------------------- -------------- ----- ---- -----------------------
it is usually a better choice, and in this case, it is ActiveDirectory module:
Import-module ActiveDirectory Get-ADDomain
this module The complete documentation can be found. But, let's answer your question. Generally, your syntax will work, but not for COM properties. For example, you can do this:
$ TopLevel.Fields.Count returns back to my computer
But the name is COM property, Therefore you need to use the Select-Objects
:
$ TopLevel.Fields | Selection object * Properties: System .__ ComObject ActualSize: 194 Properties: 32 DefinedSize: 4000 Name: distinguishedName Type: 202 Price: CN = Exchange Organization Administrator, OU = Microsoft Exchange Protection Group, DC = XXXXXXXX, DC = XXX Precision: 255 NumericScale: 255 OriginalValue: UnderlyingValue: DataFormat: status: 0
TopLevel.Fields.Name to get your specific questions so, to answer ($ how), you do this Will:
Comments
Post a Comment