Re: Error using LDAP query




You said this line "fails with numbers":
Set oUser = GetObject("LDAP://"; & oADSysInfo.UserName)

Those numbers are probably error codes, and they might help you (an others
here) troubleshoot this. If that line is failing, it probably means the
line before it (Set oADSysInfo = CreateObject("ADSystemInfo")) has failed
and now oADSysInfo is null and can't be used in the next line.


"David" <David@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3173A0F9-7293-4ECF-B085-6BEECE739406@xxxxxxxxxxxxxxxx
> The user is a local admin of the machine. I have researched this script
> thoroughly, and the lines of code I included in the post are correct. To
> anwser your question, the users does have full control of that dll file.
>
> Thanks for the reply, any other suggestions.
>
> "Marty List" wrote:
>
>>
>> This script runs on Windows XP SP1 with a domain account that is not a
>> member of Domain Admins or the local Administrators:
>>
>> On Error GoTo 0
>> Set oADSysInfo = CreateObject("ADSystemInfo")
>> WScript.Echo oADSysInfo.UserName
>> Set oUser = GetObject("LDAP://"; & oADSysInfo.UserName)
>> WScript.Echo oUser.distinguishedName
>> Set oUser = Nothing
>> ' For troubleshooting, try again with the domain specified:
>> Set oUser = GetObject("LDAP://"; & oADSysInfo.DomainDNSName & _
>> "/" & oADSysInfo.UserName)
>> WScript.Echo oUser.distinguishedName
>>
>>
>> Make sure the users have read access to this file:
>> %SystemRoot%\system32\Activeds.dll
>>
>>
>>
>> "David" <David@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:AF09C4C5-86ED-4C90-A5AA-A9D8750162C0@xxxxxxxxxxxxxxxx
>> > I have currently wrote a logon script for my domain user accounts. The
>> script
>> > basically query's AD for group membership and then maps drives
>> accordingly. I
>> > tested the script on myself and all was fine. I tested on a couple of
>> users
>> > and I get errors, nothing works. I get an error with nubmers and
>> > "source:null" on the same line every time:
>> >
>> > Set oUser = GetObject("LDAP://"; & oADSysInfo.UserName)
>> >
>> > The script basically is general and includes this:
>> >
>> > Dim oNetwork
>> > Dim oADSysinfo
>> > Dim oUser
>> > Dim sGroups
>> >
>> > 'Defining values and querying AD for user information
>> >
>> > Set oNetwork = CreateObject("WScript.Network")
>> > Set oADSysInfo = CreateObject("ADSystemInfo")
>> > Set oUser = GetObject("LDAP://"; & oADSysInfo.UserName)
>> > sGroups = LCase(Join(oUser.MemberOf))
>> >
>> > 'Checking group membership and mapping appropriate drive
>> >
>> > 'Mapping the H: drive for users per group membership
>> >
>> > If Instr(sGroups, G_MEM) Then
>> > oNetwork.MapNetworkDrive "H:", "\\server\share
>> > End If
>> >
>> > More to this script, but this is the most relavent part. Can anyone
>> > help
>> > please. The only thing different is that I am a domain admin, but of
>> course
>> > everyone cannot be a domain admin.
>> >
>> > Thanks
>> >
>> >
>> >
>>
>>
>>


.



Relevant Pages

  • Re: Error using LDAP query
    ... > I have currently wrote a logon script for my domain user accounts. ... > basically query's AD for group membership and then maps drives ... > Dim oADSysinfo ... > everyone cannot be a domain admin. ...
    (microsoft.public.windows.server.scripting)
  • Re: Error using LDAP query
    ... The user is a local admin of the machine. ... I have researched this script ... >> Dim oADSysinfo ... >> everyone cannot be a domain admin. ...
    (microsoft.public.windows.server.scripting)
  • RE: export user accounts from NT 4.0 domain
    ... ATTENTION THE SCRIPT MUST BE RUNNED FROM A COMPUTER WHERE EXCEL IS ... from the information in a Microsoft Excel spreadsheet. ... Dim strLast, strFirst, strMiddle, strPW, intRow, intCol ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • Re: Password Expire
    ... We have one fron end Edge server in our DMZ which passes email onto two ... I used to schedule a script to run every 24 hours on my Exchange 2003 ... Dim fso, txtarray, BodyText ... Call ProcessFolder (objContainer, numDays) ...
    (microsoft.public.exchange.admin)
  • Re: LDAP query information
    ... a "Dim" statement. ... execution of the script. ... ' Filter on computer object. ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)

Quantcast