Forward your code and I'll take a look. Regards, Robbie Allen http://www.rallenhome.com/
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Oliver Marshall > Sent: Friday, December 05, 2003 11:22 AM > To: [EMAIL PROTECTED] > Subject: RE: [ActiveDir] [Slightly OT] OU of a user in AD > > My mistake, its working ok, but its not returning what I > expected. Just the domain name rather the the OU it resides in. > > -----Original Message----- > From: Robbie Allen [mailto:[EMAIL PROTECTED] > Sent: 05 December 2003 16:13 > To: [EMAIL PROTECTED] > Subject: RE: [ActiveDir] [Slightly OT] OU of a user in AD > > If you want to get the RDN (e.g. cn=Users), use this: > > GetObject(objUser.Parent).Name > > If you want to get just the name of the parent (e.g. Users), use this: > > GetObject(objUser.Parent).Get("name") > > This isn't the most efficient way to do things if you are going to > iterate over a bunch of users. You'd be better off parsing the > distinguished name of the user. There are some functions in IADsTools > that can help with this if you are interested in that. > > Robbie Allen > http://www.rallenhome.com/ > > > ________________________________ > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Oliver Marshall > Sent: Friday, December 05, 2003 10:49 AM > To: [EMAIL PROTECTED] > Subject: [ActiveDir] [Slightly OT] OU of a user in AD > > > > Does anyone know if the OU of a user can be retrieved via a > script ? > > > > I am using the following to TRY and set the description of the > user to its OU (dont ask). but I cant find an OU parameter or similar > that i can query. > > > > For Each objUser in objDomain > > > > objUser.description=objuser.ou > > objUser.SetInfo > > > > next > > > List info : http://www.activedir.org/mail_list.htm > List FAQ : http://www.activedir.org/list_faq.htm > List archive: > http://www.mail-archive.com/activedir%40mail.activedir.org/ > List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
