Modifying AD User Attributes at User Creation

Author Message
MarksFGX

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 10/23/2009
  • Status: offline
Modifying AD User Attributes at User Creation Monday, October 26, 2009 2:26 AM (permalink)
0
Hello I have created a script which runs from my IIS 5 server using full admin rights.  I have recently been asked to set the manager attribute during user creation.  Unfortunately I can not seem to find the correct format to assign to this field.
 
For LP = LBound(depts) to UBound(depts)
 strADsPath = "ldap://CN/=" & super & ",ou=Users,ou=" & depts(LP) & ",ou=" & site & ",ou=sites,DC=domain,DC=com"
'Response.Write strADsPath
On Error Resume Next
  Set oSuper = GetObject(strADsPath)
  if (err.number = 0) then
   Response.Write "Bound to bind to ADSI object  " & strADsPath
   Response.Write oSuper.ADsPath
   oUser.Put "manager", oSuper.ADsPath
   Response.Write Err.number%><br><%
   oUser.SetInfo
  end if
Next
 
 
Any thoughts would be greatly appreciated.
 
#1
    MarksFGX

    • Total Posts : 3
    • Scores: 0
    • Reward points : 0
    • Joined: 10/23/2009
    • Status: offline
    Re:Modifying AD User Attributes at User Creation Monday, October 26, 2009 4:27 AM (permalink)
    0
    Never mind i figured it out, it apparently wants a string DN as its value had to use the mid string operator to pull out the LDAP:\\ from the oSuper.ADsPath value before applying it to the manager attrib.
     
    Thanks any way.
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9