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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Updating AD

Updating AD

Scheduled Pinned Locked Moved Visual Basic
helptutorial
3 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.
  • W Offline
    W Offline
    waddie1
    wrote on last edited by
    #1

    Hey all I have a problem updating AD when the value I want to pass in is empty. When I do this I get a login credentials pop up but when the value is not empty it updates fine. An example piece of code: Dim user as DirectoryEntry Dim name as string = "" user = getUserFromAD(AccountID) 'This returns a directory entry from AD user.Properties("givenName").Value = name If I actually go to AD and modify it then empty strings are allowed. Any help will be much appreciated, thanks in advance.

    D 1 Reply Last reply
    0
    • W waddie1

      Hey all I have a problem updating AD when the value I want to pass in is empty. When I do this I get a login credentials pop up but when the value is not empty it updates fine. An example piece of code: Dim user as DirectoryEntry Dim name as string = "" user = getUserFromAD(AccountID) 'This returns a directory entry from AD user.Properties("givenName").Value = name If I actually go to AD and modify it then empty strings are allowed. Any help will be much appreciated, thanks in advance.

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

      I'm not 100% sure about this, but I don't think you can't set a property to an empty, or null, value. In order to accompish something similar to that, you'd have to remove the property involved from the properties collection of the host object. Sorry, I don't have any examples because I haven't done any AD development.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      W 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I'm not 100% sure about this, but I don't think you can't set a property to an empty, or null, value. In order to accompish something similar to that, you'd have to remove the property involved from the properties collection of the host object. Sorry, I don't have any examples because I haven't done any AD development.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        W Offline
        W Offline
        waddie1
        wrote on last edited by
        #3

        Cheers, I thought it would be something like that. I'll just use the work-around of entering a single space in when the value I want to send in is empty, then when retrieving the data I'll check for that and return an empty string to the UI.

        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