Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Re: PSH: DirectoryEntry doesn't have Path Property???

Reply
 
Old 08-02-2006   #1 (permalink)
Abhishek Agrawal [MSFT]


 
 

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 SpecsSystem Spec
Old 08-03-2006   #2 (permalink)
Alex K. Angelopoulos [MVP]


 
 

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 SpecsSystem Spec
Old 08-03-2006   #3 (permalink)
Arul Kumaravel [MSFT]


 
 

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 SpecsSystem Spec
Reply

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46