So, the code I used to send logonhours data to AD :
DirEntry.Proper ties["logonHours "].Value = baLogonHours as object; //
baLogonHours = byte[]
the code I used to create the byte array :
private byte[] ArrayTologonHou rs(bool[,] arrblnLogonHour sA)
{
byte[] byteLogonHour = new byte[21];
// Mise en forme avec changement de l'ordre de la semaine
int index21 = 0;
int index24 = 0;
for(int i=1; i <= 7; i++)
{
for(int j=1;j <= 3;j++)
{
byte byte8Hours = new byte();
for(int k=7; k >= 0; k--)
{
if (i < 7)
{
if (arrblnLogonHou rsA[i,index24])
byte8Hours += (byte)Math.Pow( 2, (double)k);
}
else
{
if (arrblnLogonHou rsA[0,index24])
byte8Hours += (byte)Math.Pow( 2, (double)k);
}
index24++;
}
byteLogonHour[index21] = byte8Hours;
index21++;
}
index24 = 0;
}
return byteLogonHour;
}
I got this error :
"Erreur non spécifiée
Active Directory at System.Director yServices.Inter op.IAds.PutEx(I nt32
lnControlCode, String bstrName, Object vProp)
at System.Director yServices.Prope rtyValueCollect ion.set_Value(O bject
value)"
at the line where I send the datas to AD...
What is the problem ? Thank you in advance...
JBrek
"Marc Scheuner [MVP ADSI]" wrote:
How can i set the LogonHours to users, using System.Director yServices?
I think I must create a byte array, but it doesn't" work.
Yes, that's exactly how you do it - can you show us the code that
you're using? What is not working? Do you get an error? Where, and
what exactly is it?
Marc