![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Re: active directory question "JayJ" <JayJ@xxxxxx> wrote in message news:CFCD1602-0796-4668-B42B-5F470E4EAD90@xxxxxx Quote: > Thank you for the time you took to review this script. Your suggestions on > making the script more efficient and how to handle errors better were very > helpful. > > I am having trouble with the Name translate but think i have an idea that > will work for my purposes - if I can get the correct syntax. Once i run > the > original script I need to query AD with the distiguised name being read > from > a file and return the user principal name > > The format of the list of names in a file called ad.txt is - > > CN=Smith\, Joe,OU=Users,OU=Default,DC=test,DC=com > > Below is what I think should work but it is failing. Can you provide any > help with this? > ******************************************************* > Const ForReading = 1 > Const UserFilename = "ad.txt" > > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set objTextFile = objFSO.OpenTextFile(UserFilename, ForReading) > Do Until objTextFile.AtEndOfStream > strUser = objTextFile.ReadLine > > 'it doesnt seem to like this line??? > Set objUser = GetObject _ ("LDAP://" & strUser") > > 'For Each strUsrName In objUser > WScript.Echo "User Principal Name: " & strUsrName.userPrincipalName > > Next > > Loop > > ********************************** > > Thank you, > continue a single statement on the next line (to avoid scrolling or line wrapping in news readers for example). The statement should be either: Set objUser = GetObject("LDAP://" & strUser") or: Set objUser = GetObject _ ("LDAP://" & strUser") -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Why isn't my question being displayed? - Active Directory Problem | Vista networking & sharing | |||
| active directory | PowerShell | |||
| display active directory attributes - not easy question for experts too :-) | PowerShell | |||
| Active Directory | Vista mail | |||
| Active Directory | Vista General | |||