I ran accross this the other day and so far have not found a solution.
I'm sure it can easily be done once you know the correct syntax or method.

I had a lot of accounts in the Active Directory that had some invalid data on their ProfilePath

It is easy to query or update data on the Active Directory, but I could not figure out how to delete the entry and leave it blank.

Example:





$UserGroup = GetObject('LDAP://etc...')
for each $user in $UserGroup
if $user.class = "user"
if NOT $user.profilePath =""
? 'Profile path for '+$user.name+ 'is not blank - it is: '+$user.profilepath
$user.profilePath=""
$user.SetInfo
endif
endif
next




The user profile will not be set to blank.

I can run this code and it works fine.






$UserGroup = GetObject('LDAP://etc...')
for each $user in $UserGroup
if $user.class = "user"
if NOT $user.profilePath =""
? 'Profile path for '+$user.name+ 'is not blank - it is: '+$user.profilepath
$user.profilePath="Anything I want it to be except BLANK"
$user.SetInfo
endif
endif
next




I found this to be true for other fields as well, which leads me to believe that there must be some special syntax, or method to accomplish a BLANK entry or Delete (without replacing) and entry.

You can create/delete to have a BLANK entry with the GUI tools, so I know it can be done.

Does anyone know the proper method to BLANK/DELETE an entry?