aaltieri
05-07-2008, 02:18 PM
Greetings!
I am building an excel spreadsheet to log some data from our AD network and have run into a bit of a snag.
I'm looking at all the properties that an object (a user in this example) has in AD. I'm using a loop that looks like:
For Each prop In schobj.mandatoryproperties
targetrng.Offset(i, 0) = prop 'enters the data into the spreadsheet
i = i + 1 'increments once to move to the next row for the next property
Next
This lists all the properties (well, the mandatory ones in this case) for me in an excel spreadsheet. Now, what I need it to do is to also print out the value of those properties. I'm trying to do this by referring to the specific field via a variable. Something like:
targetrng.Offset(i, 0) = userObj.$prop
Using the variable name Prop, in lieu of having to hard code every single property like:
userObj.cn
userObj.objectSID
etc...
I would seriously appreciate any help as we have over 200 properties for the user objects...and if at all possible, I'd like to use the same bit of code for container objects and computers.
Peace
anthony.
I am building an excel spreadsheet to log some data from our AD network and have run into a bit of a snag.
I'm looking at all the properties that an object (a user in this example) has in AD. I'm using a loop that looks like:
For Each prop In schobj.mandatoryproperties
targetrng.Offset(i, 0) = prop 'enters the data into the spreadsheet
i = i + 1 'increments once to move to the next row for the next property
Next
This lists all the properties (well, the mandatory ones in this case) for me in an excel spreadsheet. Now, what I need it to do is to also print out the value of those properties. I'm trying to do this by referring to the specific field via a variable. Something like:
targetrng.Offset(i, 0) = userObj.$prop
Using the variable name Prop, in lieu of having to hard code every single property like:
userObj.cn
userObj.objectSID
etc...
I would seriously appreciate any help as we have over 200 properties for the user objects...and if at all possible, I'd like to use the same bit of code for container objects and computers.
Peace
anthony.