Updating AD
-
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. -
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.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
-
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