![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | how do i determine the OU structure on the fly ? Each time i script, i have to hard-code the OU. Is there a method to determine the AD OU structure on the fly ? Let me give a scenario: # generic way to determine ANY ORGANISATION LDAP PATH $objOU=[ADSI]"LDAP://ROOTDSE" $OBJOU.defaultNamingContext Is there similar way like above to determine OU structure ? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: how do i determine the OU structure on the fly ? On Nov 6, 3:43*am, "IT Staff" <jkk...@newsgroup> wrote: Quote: > Each time i script, i have to hard-code the OU. Is there a method to > determine the AD OU structure on the fly ? > > Let me give a scenario: > > # generic way to determine ANY ORGANISATION LDAP PATH > $objOU=[ADSI]"LDAP://ROOTDSE" > $OBJOU.defaultNamingContext > > Is there similar way like above to determine OU structure ? "Determine the AD OU structure" - of which OU exactly, how? ![]() Martin |
My System Specs![]() |
| | #3 (permalink) |
| | Re: how do i determine the OU structure on the fly ? Let me be more specific. In company A, their OU structure could be like this: OU Country1 OU Computers OU Users. In company B, their OU structure could be like this: OU Dept1 OU Users_Computers If i write a script for Company A, i hAve to use a regular expression to detect Company A OU structure. Similarly if i write a script for Company B, the regular expression used in Company A cannot be applied to Company B. This means i have to write a regular expression for Company B. Is there a "generic" way to determine the OU structure of Two companies, rather than *hard code" a regular express for Company A and Company B respectively ? |
My System Specs![]() |
| | #4 (permalink) |
| | Re: how do i determine the OU structure on the fly ? Still don't know what exactly you want to achieve - OUs are container objects for OU, therefore you will need to do equivalent of Get-ChildItem (which can be done) and then have some logic to determine which OU is used for what - and this is suddenly almost impossible task ![]() You could of course have a logic that will match OU based on some kind of mask (for example returning first OU that contains work Users or Computers), however don't think such code would be too useful. Martin "IT STAFF" <jkklim@newsgroup> wrote in message news:ep7915uXKHA.3448@newsgroup Quote: > Let me be more specific. > > In company A, their OU structure could be like this: > > OU Country1 > OU Computers > OU Users. > > In company B, their OU structure could be like this: > > OU Dept1 > OU Users_Computers > > If i write a script for Company A, i hAve to use a regular expression to > detect Company A OU structure. > Similarly if i write a script for Company B, the regular expression used > in Company A cannot be applied to Company B. This means i have to write a > regular expression for Company B. > > Is there a "generic" way to determine the OU structure of Two companies, > rather than *hard code" a regular express for Company A and Company B > respectively ? > > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| ntfs fle structure | Vista file management | |||
| Generic regular expression to determine the OU structure | PowerShell | |||
| ASP.Net directory structure | .NET General | |||
| folder structure?? | Vista file management | |||
| Old Disc structure. | Vista installation & setup | |||