[THIN] Re: OT :W2K OU -> user. Moving Info Script.

  • From: "Braebaum, Neil" <Neil.Braebaum@xxxxxxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Thu, 20 Mar 2003 16:46:08 -0000

Comments inline...

> -----Original Message-----
> From: Davey [mailto:DB1001@xxxxxxxxxxxxxxx] 
> Sent: 20 March 2003 16:26
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: OT :W2K OU -> user. Moving Info Script.
> 
> On Thu, 2003-03-20 at 15:19, Braebaum, Neil wrote:
> > 
> > When you say "address information" what do you mean?
> Under the general tab of the OU properties you have : 
> description Street City State/Province Zip Country

This appears to be available as: description and postaladdress properties of
the IADsOU interface.

> > Have you identified the properties you wish to modify on the user 
> > accounts?
> 
> On the user properties, Address tab you have similar boxes. 
> Street PO BOx City Zip Country

Again, for the IADsUser interface / object you have a description property,
and a postaladdress property.

> > It all sounds plenty easy using ADSI scripting - but I'd need to 
> > understand what you mean a bit more.
> 
> What I'd like to do is take the information from the OU 
> general tab and copy this into the users address tab - as 
> much as I can.. Obviously there are some differences. Each OU 
> has a different address and so I'd need to check for each OU 
> and then all the users under that OU and then write the 
> information into the Users address tab. I'd then need to pick 
> up the next OU (e.g. OU2), check to make sure I have the info 
> in the general tab and add this to the users in OU2.. and 
> repeat until I didn't have anymore OUs 

You'd have to use the LDAP provider - these properties are only available
using that provider.

It all sounds fairly easy - open RootDSE, get the defaultnamingcontext, open
that (so effectively you are starting at the top of your directory),
evaluate all objects.

For OU objects, get the adspath, pass it to a recursive function that opens
the OU object with the adspath passed.

Get the description and postaladdress properties of the OU you've just
opened (acksherly it looks like you only want the postaladdress), and
remember it in your head (think cheap card trick) - I'm messing with you ;-)
- store it.

Then evaluate all user objects within the OU. Set the stored postal address
on all user objects you evaluate.

Then evaluate all OUs within the current OU. For each OU object, call the
very same recursive function with the adspath you've just got, and it'll
carry on down the hierarchy / tree.

When you've finished, you'll discover the card you chose, and are holding
behind your back, is actually the 8 of diamonds. Impressed?

I described the workings of how to do this in rather generic terms, because
I'm not sure what your chosen method of scripting may be, but this is all
perfectly doable, and easy, with ADSI scripting.

Pick a card, any card... ;-)

Neil

***********************************************************************
This e-mail and its attachments are intended for the above named 
recipient(s) only and are confidential and may be privileged.
If they have come to you in error you must take no action based 
on them, nor must you copy or disclose them or any part of 
their contents to any person or organisation; please notify the 
sender immediately and delete this e-mail and its attachments from 
your computer system.

Please note that Internet communications are not necessarily secure 
and may be changed, intercepted or corrupted. We advise that 
you understand and observe this lack of security when e-mailing us 
and we will not accept any liability for any such changes, 
interceptions or corruptions. 

Although we have taken steps to ensure that this e-mail and its 
attachments are free from any virus, we advise that in keeping 
with good computing practice the recipient should ensure they 
are actually virus free.

Copyright in this e-mail and attachments created by us belongs 
to Littlewoods. 

Littlewoods takes steps to prohibit the transmission of offensive, 
obscene or discriminatory material.  If this message contains 
inappropriate material please forward the e-mail intact to 
postmaster@xxxxxxxxxxxxxxxxx and it will be investigated. 
Statements and opinions contained in this e-mail may not 
necessarily represent those of Littlewoods.

Please note that e-mail communication may be monitored.

Registered office: 
Littlewoods Retail Limited, 
Sir John Moores Building, 
100 Old Hall Street, 
Liverpool,
L70 1AB 
Registered no: 421258 

http://www.littlewoods.com 
***********************************************************************
*********************************************************
This Week's Sponsor - RTO Software / TScale
TScale increases terminal server capacity. 
Get 30-40% more users per server to save $$$ and time. 
Add users now! - not more servers. If you're using Citrix, 
you must learn about TScale!  Free 30-day eval:
http://www.rtosoft.com/Enter.asp?ID=79
**********************************************************

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts: