Here is my dilemma. Our company has three levels of user - Exec, Staff, and Nonperson (i.e. an account that represents a role and not an individual - such as 'administrator'). Currently this information is in nested groups - i.e. there is an 'Exec' group that
contains 'ny-exec' and 'la-exec', etc. I wrote a script that set the 'employeeType' attribute for members of one of these groups. This code worked fine, here is a snippet:
Dim type As String = IIf(exec.Checked, "Executive", "Staff")
Dim individual As DirectoryEntry = root
'Root is the person's DE from a higher level function
individual.AuthenticationType = AuthenticationTypes.Secure
'user and pass are valid for an administrator of the domain
individual.Username = user
individual.Password = pass
individual.Properties("employeeType").Add(type)
The employeeType attribute gets set properly
However, when I try to update this feature, by replacing the bolded line above with:
individual.Properties("employeeType").value=type
I get the following error:The Active Directory datatype cannot be converted
to/from a native DS datatype Anyone have any advice?
yonah
Member
590 Points
118 Posts
I can add a property just fine, but I can't 'Edit'
Aug 13, 2003 06:41 PM|LINK
Dim type As String = IIf(exec.Checked, "Executive", "Staff") Dim individual As DirectoryEntry = root 'Root is the person's DE from a higher level function individual.AuthenticationType = AuthenticationTypes.Secure 'user and pass are valid for an administrator of the domain individual.Username = user individual.Password = pass individual.Properties("employeeType").Add(type)The employeeType attribute gets set properly However, when I try to update this feature, by replacing the bolded line above with:individual.Properties("employeeType").value=typeI get the following error:The Active Directory datatype cannot be converted to/from a native DS datatype Anyone have any advice?