![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: PSH: DirectoryEntry doesn't have Path Property??? Fwding to PowerShell newsgroup -- Abhishek Agrawal [MSFT] http://spaces.msn.com/abhishek225 Windows PowerShell Team Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Abhishek Agrawal [MSFT]" <abhiag@online.microsoft.com> wrote in message news:e0BNCYptGHA.3912@TK2MSFTNGP03.phx.gbl... > PowerShell "adapts" a set of .Net Types to provide a more useful view of > the properties from inside powershell. DirectoryEntry is one such types > (Others being ManagementObject, XmlNode etc). > > This allows you to do things like: >>$a = new-object System.DirectoryServices.DirectoryEntry >>"IIS://localhost/W3SVC" >>$a.MaxConnections > 10 > > This makes it easier than doing $a.Properties["MaxConnections"]. We call > this view of the object the "adapted". But as you mentioned there are > cases when you want to access the properties as defined on the raw > DirectoryEntry object. For that we expose a special property called > "psbase" which lets you get to the properties as defined on the "base > object". > so you can do this: > > $a.psbase.path > IIS://localhost/W3SVC > > We are improving ADSI support in powershell. Check out the following blogs > for info on whats coming: > > http://blogs.msdn.com/arulk/archive/...28/682289.aspx > http://blogs.msdn.com/arulk/archive/...28/682289.aspx > > -- > Abhishek Agrawal [MSFT] > http://spaces.msn.com/abhishek225 > Windows PowerShell Team > Microsoft Corporation > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > "OK" <OK@discussions.microsoft.com> wrote in message > news:8D2E9641-9CB8-44C3-89FF-CB8CD7435B7C@microsoft.com... >>I made it work by replacing all properties by corresponding calls to get_* >> and set_ methods. >> Still wondering why properties can't be used? >> >> $de.set_Path("IIS://localhost/W3SVC"); >> >> #$de | get-member >> >> foreach($child in $de.get_Children()) { >> $child.get_SchemaClassName(); >> } >> > > |
My System Specs![]() |
| | #2 (permalink) |
| | Re: PSH: DirectoryEntry doesn't have Path Property??? Arul, you only have 1 actual blog entry shown (repeated 2 times). Did you mean to include your own entry from 2006-07-25 as well? If so, the list should be: http://blogs.msdn.com/arulk/archive/...28/682289.aspx http://blogs.msdn.com/arulk/archive/...25/678137.aspx "Abhishek Agrawal [MSFT]" <abhiag@online.microsoft.com> wrote in message news:%23JaJmdptGHA.2232@TK2MSFTNGP05.phx.gbl... > Fwding to PowerShell newsgroup > > -- > Abhishek Agrawal [MSFT] > http://spaces.msn.com/abhishek225 > Windows PowerShell Team > Microsoft Corporation > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > "Abhishek Agrawal [MSFT]" <abhiag@online.microsoft.com> wrote in message > news:e0BNCYptGHA.3912@TK2MSFTNGP03.phx.gbl... >> PowerShell "adapts" a set of .Net Types to provide a more useful view of >> the properties from inside powershell. DirectoryEntry is one such types >> (Others being ManagementObject, XmlNode etc). >> >> This allows you to do things like: >>>$a = new-object System.DirectoryServices.DirectoryEntry >>>"IIS://localhost/W3SVC" >>>$a.MaxConnections >> 10 >> >> This makes it easier than doing $a.Properties["MaxConnections"]. We >> call this view of the object the "adapted". But as you mentioned there >> are cases when you want to access the properties as defined on the raw >> DirectoryEntry object. For that we expose a special property called >> "psbase" which lets you get to the properties as defined on the "base >> object". >> so you can do this: >> > $a.psbase.path >> IIS://localhost/W3SVC >> >> We are improving ADSI support in powershell. Check out the following >> blogs for info on whats coming: >> >> http://blogs.msdn.com/arulk/archive/...28/682289.aspx >> http://blogs.msdn.com/arulk/archive/...28/682289.aspx >> >> -- >> Abhishek Agrawal [MSFT] >> http://spaces.msn.com/abhishek225 >> Windows PowerShell Team >> Microsoft Corporation >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> "OK" <OK@discussions.microsoft.com> wrote in message >> news:8D2E9641-9CB8-44C3-89FF-CB8CD7435B7C@microsoft.com... >>>I made it work by replacing all properties by corresponding calls to >>>get_* >>> and set_ methods. >>> Still wondering why properties can't be used? >>> >>> $de.set_Path("IIS://localhost/W3SVC"); >>> >>> #$de | get-member >>> >>> foreach($child in $de.get_Children()) { >>> $child.get_SchemaClassName(); >>> } >>> >> >> > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: PSH: DirectoryEntry doesn't have Path Property??? Cut and Copy error. Thanks for poiting this out. You have pointed out the correct urls. http://blogs.msdn.com/arulk/archive/...28/682289.aspx http://blogs.msdn.com/arulk/archive/...25/678137.aspx -- Arul Kumaravel [MSFT] Development Manager, Windows PowerShell, Microsoft Corporation My PowerShell Blog: http://blogs.msdn.com/arulk This posting is provided "AS IS" with no warranties, and confers no rights "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message news:%23HF%23tRxtGHA.1504@TK2MSFTNGP03.phx.gbl... > Arul, you only have 1 actual blog entry shown (repeated 2 times). Did you > mean to include your own entry from 2006-07-25 as well? If so, the list > should be: > > > > "Abhishek Agrawal [MSFT]" <abhiag@online.microsoft.com> wrote in message > news:%23JaJmdptGHA.2232@TK2MSFTNGP05.phx.gbl... >> Fwding to PowerShell newsgroup >> >> -- >> Abhishek Agrawal [MSFT] >> http://spaces.msn.com/abhishek225 >> Windows PowerShell Team >> Microsoft Corporation >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> "Abhishek Agrawal [MSFT]" <abhiag@online.microsoft.com> wrote in message >> news:e0BNCYptGHA.3912@TK2MSFTNGP03.phx.gbl... >>> PowerShell "adapts" a set of .Net Types to provide a more useful view of >>> the properties from inside powershell. DirectoryEntry is one such types >>> (Others being ManagementObject, XmlNode etc). >>> >>> This allows you to do things like: >>>>$a = new-object System.DirectoryServices.DirectoryEntry >>>>"IIS://localhost/W3SVC" >>>>$a.MaxConnections >>> 10 >>> >>> This makes it easier than doing $a.Properties["MaxConnections"]. We >>> call this view of the object the "adapted". But as you mentioned there >>> are cases when you want to access the properties as defined on the raw >>> DirectoryEntry object. For that we expose a special property called >>> "psbase" which lets you get to the properties as defined on the "base >>> object". >>> so you can do this: >>> > $a.psbase.path >>> IIS://localhost/W3SVC >>> >>> We are improving ADSI support in powershell. Check out the following >>> blogs for info on whats coming: >>> >>> http://blogs.msdn.com/arulk/archive/...28/682289.aspx >>> http://blogs.msdn.com/arulk/archive/...28/682289.aspx >>> >>> -- >>> Abhishek Agrawal [MSFT] >>> http://spaces.msn.com/abhishek225 >>> Windows PowerShell Team >>> Microsoft Corporation >>> This posting is provided "AS IS" with no warranties, and confers no >>> rights. >>> >>> >>> "OK" <OK@discussions.microsoft.com> wrote in message >>> news:8D2E9641-9CB8-44C3-89FF-CB8CD7435B7C@microsoft.com... >>>>I made it work by replacing all properties by corresponding calls to >>>>get_* >>>> and set_ methods. >>>> Still wondering why properties can't be used? >>>> >>>> $de.set_Path("IIS://localhost/W3SVC"); >>>> >>>> #$de | get-member >>>> >>>> foreach($child in $de.get_Children()) { >>>> $child.get_SchemaClassName(); >>>> } >>>> >>> >>> >> >> > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Set Focus To Specific Property In Property Grid | .NET General | |||
| System.DirectoryServices.DirectoryEntry & the accountExpires property | PowerShell | |||
| BUG? (Test-Path $path -IsValid) and empty $path | PowerShell | |||