Provisioning to Novell eDirectory using MIIS: Setting initial eDirectory Password
Provisioning to Novell eDirectory using MIIS: Setting initial eDirectory Password
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm
Recently I was involved in a project where I needed to provision new user and group accounts into Novell eDirectory using Microsoft Identity Integration Server 2003 (MIIS). For the most part I found this process to be very similar to that of provisioning to Active Directory with one notable exception, that being of setting-up the initial password for an inetOrgPerson in provisioning code.
When provisioning to Active Directory we could simply do something like this when setting-up the initial password: csentry("unicodepwd").Values.Add("PA$$w0rd").
If you try passing a sting to csentry("userPassword").Values.Add("PA$$w0rd") while provisioning to eDirectory you will get "Invalid base64 string" exception. Apparently, eDirectory expects the password to be in the Base64String format.
Here is a sample function that will allow you to convert a String into Base64String format.
' This module converts a string to Base64 string,
'
' Input parameters:
' NormalString: String to be converted to 64Base format
' Output:
' Input string converted into Base64
Public Function ConvertStringToBase64String(ByVal strNormalString As String) As String
Dim aByteArray As Byte()
Dim encoder As New System.Text.ASCIIEncoding
aByteArray = encoder.GetBytes(strNormalString)
Dim strBase64String As String = System.Convert.ToBase64String(aByteArray, 0, aByteArray.Length)
Return strBase64String
End Function
So using this function you can now set the initial password for an inetOrgPerson by doing the following csentry("userPassword").Values.Add(ConvertStringToBase64String("PA$$w0rd"))