By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

How to get a users OU in AD?

P: n/a
Currently I use this code to display a users real name on a report when
they print it.

Private DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\",
"/")
Private ADEntry As New
System.DirectoryServices.DirectoryEntry("WinNT://" & DomainUser)
Private FullName As String = ADEntry.Properties("FullName").Value

Now what I need to do is get the user's Organizations Unit they belong
too.

Our users are organized based on thier location like "STC_Houston" or
"STC_Dallas" or "STC_LasVegas"

Anyone know how I can return this OU (Organizational Unit)?

I've been searching google for an hour and can't seem to find anything.

Thanks,
Izzy

Nov 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.