FIND LDAP PATH of COMPUTER OBJECT
- From: "WUV999U" <usbharath.ganesh@xxxxxxxxx>
- Date: 18 Oct 2006 22:14:24 -0700
Hi
I'm a noob and have been trying to write a code in VBS to find the ldap
path of a computer object in vain..
So far, I have
------
set UserData = CreateObject("ADSystemInfo")
'load string into array
OUArray = Split(Userdata.computername,",")
'loop through array elements
For Each OU in OUArray
'if we found an OU in the array element
If UCase(Left(OU,2))="OU" Then
'trim off the first 3 characters
OUName = Mid(OU,4)
'add to output string
OUList = OUName & vbcrlf
End If
Next
wscript.echo OUList
------
But it doesn't return the OUs properly.
I mean, say if the LDAP path of the computer object is
LDAP://OU=D,OU=C,OU=B,OU=A,DC=XYZ,DC=MI,DC=EDU
then the code above just returns B
and I would like to find the whole path as in
XYS.MI.EDU/A/B/C/D
I could use some help if I may..
& I relle appreciate it..
Thanks so much
.
- Prev by Date: Re: coax P&D Wizard to install mdac on target machine during std. installation, possible?
- Next by Date: Re: Compile Differences, WinXP-Pro and Win2K
- Previous by thread: Compile Differences, WinXP-Pro and Win2K
- Next by thread: checkbox
- Index(es):
Loading