Re: CreateADUSer function



It is hard to say where the problem lies, as you have not shared the code
that conditionally calls this function or the code that sets the global
variables it uses.

To see if the problem is in the function itself, I'd suggest pasting it into
a short test script that sets reasonable values for stracctname and etc. and
then calls the function unconditionally. If that still fails and no errors
are flagged, add code to the function to display the variables to make sure
you are not, for example, spelling them differently in the main program.

As a point of style and maintainability, a function like this makes much
more sense when the values it needs are passed as parameters, rather than
through global variables.

/Al

"Ralph Karam" <RalphKaram@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:63C51000-37D3-4D18-B37B-37D02A21A6AB@xxxxxxxxxxxxxxxx
I'm unable to find out why my user accounts are not being created I've
got
an If then statement higher that calls this function if I want the user
created. i know none of the users exist because I'm testing against an
empty
domain.

'**********************************************
Function CreateUser
Set objou = GetObject("LDAP:\\OU=Users,OU=" & strstate & "," & strDCRoot)
Set objUser = objou.Create("User","CN= " & strlname & "\, " & strfname)
objuser.sAMAccountname = stracctname
objuser.SetInfo
objuser.givenName = strfname
objuser.sn = strlname
objuser.displayName = strdisplayname
objuser.mail = strmail
objuser.SetPassword strPWD
objUser.SetInfo
objUser.AcountDisabled = False
objUser.SetInfo
' WScript.Echo "Account: " & strdisplayname & " created successfully"
End Function

'*************************************
Ralph


.



Relevant Pages

  • Re: Desktop display
    ... The problem lies in a couple of areas. ... Number one is that I cannot change the wallpaper. ... When I went into display in control panel, ... but the desktop tab functions (where you can ...
    (microsoft.public.windowsxp.perform_maintain)
  • WM5 Internet Explorer: Address is not valid
    ... Explorer will stop working and display the error message ... ... I'm able to use the Opera browser and connect, so the problem lies ...
    (microsoft.public.pocketpc.developer)
  • Re: email address format
    ... > The display name shouldn't matter at all....if the recipient opens the ... exchange, but some strange settings in the clients; ... > if you open the user in ADUC what is the display name set to? ... thank you for your reply; you convinced me the problem lies ...
    (microsoft.public.exchange2000.admin)
  • Re: Newbie question
    ... > incr line_number 1 ... The problem lies here: you assign the variable $line to contain a line from ... but you never display that variable. ... Regards, ...
    (comp.lang.tcl)

Loading