![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | ADSI: Making an Explicit Call to GetInfoEx and Enumerating Results "Rather than download most attributes of an object, you can selectively load or refresh the local property cache with a specific attribute or set of attributes by using the GetInfoEx method." Desired output, the actual Active Directory values for the attributes in the array. CODE: Set objUser = GetObject _ ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") arrAttributes = Array("description", "name") objUser.GetInfoEx arrAttributes, 0 For Each Attribute In arrAttributes WScript.Echo Attribute Next EXPECTED OUTPUT: Account used for testing. TestUser ACTUAL OUTPUT: description name ==================== What am I misunderstanding? The array shouldn't actually be composed of the strings "description" and "name" but the returned values of those AD attributes. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Making an Explicit Call to GetInfoEx and Enumerating Results "Larry" <Larry@xxxxxx> wrote in message news:74A40BA2-7F23-4CA9-B6D9-7D722E99F89E@xxxxxx Quote: > "Rather than download most attributes of an object, you can selectively > load > or refresh the local property cache with a specific attribute or set of > attributes by using the GetInfoEx method." > > Desired output, the actual Active Directory values for the attributes in > the > array. > > CODE: > Set objUser = GetObject _ > ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") > arrAttributes = Array("description", "name") > objUser.GetInfoEx arrAttributes, 0 > For Each Attribute In arrAttributes > WScript.Echo Attribute > Next > > EXPECTED OUTPUT: > Account used for testing. > TestUser > > ACTUAL OUTPUT: > description > name > > ==================== > What am I misunderstanding? The array shouldn't actually be composed of > the > strings "description" and "name" but the returned values of those AD > attributes. > are cached. You then can use the Get method to retrieve the values. For example: ======= Set objUser = GetObject _ ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") arrAttributes = Array("description", "name") objUser.GetInfoEx arrAttributes, 0 For Each Attribute In arrAttributes WScript.Echo objUser.Get("Attribute") Next ======== The main reason I am aware of to use the GetInfoEx method is to retrieve the value of operational attributes (also called constructed). The GetInfoEx method forces AD to calculate the values. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Making an Explicit Call to GetInfoEx and Enumerating Results "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:utsLPVuWJHA.5064@xxxxxx Quote: > > "Larry" <Larry@xxxxxx> wrote in message > news:74A40BA2-7F23-4CA9-B6D9-7D722E99F89E@xxxxxx Quote: >> "Rather than download most attributes of an object, you can selectively >> load >> or refresh the local property cache with a specific attribute or set of >> attributes by using the GetInfoEx method." >> >> Desired output, the actual Active Directory values for the attributes in >> the >> array. >> >> CODE: >> Set objUser = GetObject _ >> ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") >> arrAttributes = Array("description", "name") >> objUser.GetInfoEx arrAttributes, 0 >> For Each Attribute In arrAttributes >> WScript.Echo Attribute >> Next >> >> EXPECTED OUTPUT: >> Account used for testing. >> TestUser >> >> ACTUAL OUTPUT: >> description >> name >> >> ==================== >> What am I misunderstanding? The array shouldn't actually be composed of >> the >> strings "description" and "name" but the returned values of those AD >> attributes. >> > The array itself is unchanged by the GetInfoEx method. Instead, all values > are cached. You then can use the Get method to retrieve the values. For > example: > ======= > Set objUser = GetObject _ > ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") > arrAttributes = Array("description", "name") > objUser.GetInfoEx arrAttributes, 0 > > For Each Attribute In arrAttributes > WScript.Echo objUser.Get("Attribute") > Next > ======== > The main reason I am aware of to use the GetInfoEx method is to retrieve > the value of operational attributes (also called constructed). The > GetInfoEx method forces AD to calculate the values. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > the GetInfoEx method is not required. It simply loads the attribute values into the cache (local memory). The advantage is that all of the values are retrieved at once, in one request to AD, rather than one request per attribute. The Get method retrieves the values from the cache first, and only requests from AD if the value is not already in the cache. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Making an Explicit Call to GetInfoEx and Enumerating Results Thanks for clearing that up. "Richard Mueller [MVP]" wrote: Quote: > > "Larry" <Larry@xxxxxx> wrote in message > news:74A40BA2-7F23-4CA9-B6D9-7D722E99F89E@xxxxxx Quote: > > "Rather than download most attributes of an object, you can selectively > > load > > or refresh the local property cache with a specific attribute or set of > > attributes by using the GetInfoEx method." > > > > Desired output, the actual Active Directory values for the attributes in > > the > > array. > > > > CODE: > > Set objUser = GetObject _ > > ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") > > arrAttributes = Array("description", "name") > > objUser.GetInfoEx arrAttributes, 0 > > For Each Attribute In arrAttributes > > WScript.Echo Attribute > > Next > > > > EXPECTED OUTPUT: > > Account used for testing. > > TestUser > > > > ACTUAL OUTPUT: > > description > > name > > > > ==================== > > What am I misunderstanding? The array shouldn't actually be composed of > > the > > strings "description" and "name" but the returned values of those AD > > attributes. > > > The array itself is unchanged by the GetInfoEx method. Instead, all values > are cached. You then can use the Get method to retrieve the values. For > example: > ======= > Set objUser = GetObject _ > ("LDAP://cn=TestUser, ou=Users, OU=Sbd, dc=us, dc=Fabrikam, dc=com") > arrAttributes = Array("description", "name") > objUser.GetInfoEx arrAttributes, 0 > > For Each Attribute In arrAttributes > WScript.Echo objUser.Get("Attribute") > Next > ======== > The main reason I am aware of to use the GetInfoEx method is to retrieve the > value of operational attributes (also called constructed). The GetInfoEx > method forces AD to calculate the values. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Error when making video call - (0x8100039d) | Live Messenger | |||
| having a problem with making a video call | Live Messenger | |||
| call of duty 4....making me ill ??? | Gaming | |||
| Enumerating group membership & ADSI | PowerShell | |||
| RE: Option Explicit | PowerShell | |||