Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. home folder

home folder

Scheduled Pinned Locked Moved Visual Basic
comhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jayesh Talsaniya
    wrote on last edited by
    #1

    i am facing an error: "can not create activex control." while creating a activex directory user home folder. the code is as below: Dim oContainer As ActiveDs.IADsContainer Dim oUser As ActiveDs.IADsUser Dim strFirstName As String Dim strLastName As String Dim strSAMAcctName As String Dim strPassword As String 'Dim oGroup As DictionaryEntry strFirstName = "First" 'Trim(Me.txtFirstName.Text) strLastName = "Last" 'Trim(Me.txtLastName.Text) strPassword = "password" strSAMAcctName = LCase(Left(strFirstName, 1) & strLastName) oContainer = GetObject("LDAP://dc=abc,dc=com") oUser = oContainer.Create("user", "cn=" & strFirstName & " " & strLastName) oUser.Put("displayName", strFirstName & " " & strLastName) oUser.Put("FirstName", strFirstName) oUser.Put("LastName", strLastName) oUser.Put("sAMAccountName", strSAMAcctName) oUser.Put("userPrincipalName", strSAMAcctName & "@abc.COM") oUser.EmailAddress = strSAMAcctName & "@abc.com" 'oUser.homedrive = "U:" oUser.HomeDirectory = "\\192.168.87.154\Home-drive\" & strSAMAcctName Try oUser.SetInfo() Catch MsgBox("User Already Exists", MsgBoxStyle.Critical, "UserExists!") End Try Try If oUser.AccountDisabled = True Then oUser.AccountDisabled = False oUser.SetInfo() End If Catch ex As Exception MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed") 'Me.txtResults.Visible = True End Try Try oUser.SetPassword(strPassword) oUser.Put("pwdLastSet", 0) oUser.SetInfo() Catch ex As Exception MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed") End Try Jayesh Talsaniya

    D 1 Reply Last reply
    0
    • J Jayesh Talsaniya

      i am facing an error: "can not create activex control." while creating a activex directory user home folder. the code is as below: Dim oContainer As ActiveDs.IADsContainer Dim oUser As ActiveDs.IADsUser Dim strFirstName As String Dim strLastName As String Dim strSAMAcctName As String Dim strPassword As String 'Dim oGroup As DictionaryEntry strFirstName = "First" 'Trim(Me.txtFirstName.Text) strLastName = "Last" 'Trim(Me.txtLastName.Text) strPassword = "password" strSAMAcctName = LCase(Left(strFirstName, 1) & strLastName) oContainer = GetObject("LDAP://dc=abc,dc=com") oUser = oContainer.Create("user", "cn=" & strFirstName & " " & strLastName) oUser.Put("displayName", strFirstName & " " & strLastName) oUser.Put("FirstName", strFirstName) oUser.Put("LastName", strLastName) oUser.Put("sAMAccountName", strSAMAcctName) oUser.Put("userPrincipalName", strSAMAcctName & "@abc.COM") oUser.EmailAddress = strSAMAcctName & "@abc.com" 'oUser.homedrive = "U:" oUser.HomeDirectory = "\\192.168.87.154\Home-drive\" & strSAMAcctName Try oUser.SetInfo() Catch MsgBox("User Already Exists", MsgBoxStyle.Critical, "UserExists!") End Try Try If oUser.AccountDisabled = True Then oUser.AccountDisabled = False oUser.SetInfo() End If Catch ex As Exception MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed") 'Me.txtResults.Visible = True End Try Try oUser.SetPassword(strPassword) oUser.Put("pwdLastSet", 0) oUser.SetInfo() Catch ex As Exception MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed") End Try Jayesh Talsaniya

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      So, on which line does this thing blow up?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups