My provisioning utility has taken to blasting constraint exceptions from COM with the 
following block of attributes. It seems to be borking on this combination, but I don't 
see the problem. I have checked twice, I have no students by this name enrolled. It 
was working a couple hours ago too. Code is below too.
 
manager: LDAP://CN=Brian Desmond,OU=Tech 
Dept,OU=Accounts,DC=payton,DC=cps,DC=k12,DC=il,DC=us
description: Student
initials: C
givenname: Captain
displayname: Captain C. Cheese
homedirectory: \\hydrogen\studentfolders\cheesec
homedrive: U:
samaccountname: cheesec
scriptpath: apps.bat
pwdlastset: 0
userprincipalname: [EMAIL PROTECTED]
sn: Cheese
employeeid: 12345678
division: 901


        Public Shared Function CreateUser(ByVal ParentDN As String, ByVal Cn As 
String, ByVal attributes As StringDictionary, ByVal Password As String) As String
            Dim parent As New DirectoryEntry("LDAP://"; & ParentDN)

            Dim user As DirectoryEntry = parent.Children.Add("cn=" & Cn, "user")

            For Each attr As String In attributes.Keys
                If Not attributes(attr) = "" Then
                    user.Properties(attr).Value = attributes(attr)
                    Debug.WriteLine(attr & ": " & attributes(attr))
                End If
            Next

            user.CommitChanges()

            user.Invoke("SetPassword", New Object() {Password})

            user.Properties("userAccountControl").Value = 
CType(user.Properties("userAccountControl").Value, Integer) Xor &H2
            If attributes.ContainsKey("pwdLastSet") Then
                user.Properties("pwdLastSet").Value = 0
            End If
            If attributes.ContainsKey("accountExpires") Then
                user.Invoke("AccountExpirationDate", New Object() 
{CType(attributes("accountExpires"), DateTime)})
            End If
            user.CommitChanges()

            Return CType(user.Properties("distinguishedName").Value, String)
        End Function
    End Class

 
 
Does anyone see what is wrong with this data?
 
--Brian

Reply via email to