Windows Vista Forums

Re: PSH: DirectoryEntry doesn't have Path Property???
  1. #1


    Abhishek Agrawal [MSFT] Guest

    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

  2. #2


    Alex K. Angelopoulos [MVP] Guest

    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

  3. #3


    Arul Kumaravel [MSFT] Guest

    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

Re: PSH: DirectoryEntry doesn't have Path Property??? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript runtime error: Object doesn't support this property or method: 'WScript.Sleep' Mark Dougherty VB Script 8 19 Nov 2008
438 Object doesn't support this property or method mcauliffe VB Script 0 09 Jul 2008
Can I use a property path as the PropertyName for the PropertyGroupDescription ? Patrice Avalon 0 01 Aug 2007
System.DirectoryServices.DirectoryEntry & the accountExpires property Clint Bergman PowerShell 8 30 Apr 2007
Re: Data binding doesn't work for Property Tag syntax ? Mikhail Avalon 0 10 Jan 2006