TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dwayne Soare
NA
1
0
Active Directory - logonHours
Jun 11 2007 5:14 PM
Hi, I'm working on a screen saver that will log users out if they are outside of their allowed logon hours. I've done this all ready in vbscript as proof of concept and I'm 95% of the way there in C#. I'm having trouble getting the user logonHours property. It returns a System.Byte[] that should be 21 bytes. Each bit representing an hour out of the week. No matter how I get the property it always returns as a object, and I can't access the values of the byte array to sort them out. My current code to get the object looks like this: object objHours; DirectoryEntry userDSE = new DirectoryEntry("LDAP://" + userDN); objHours = userDSE.Properties["logonHours"][0]; The line that creates the object works, and I have tried creating the object 2 or 3 other ways. Through the logonHours object I cannot access the values of the array. I have also used a binary stream to convert the object in to a byte array, but the byte array returns a 48 byte array that I don't trust to stay constant in size. I would prefer to access the values through the object properly. I need some help. It would be appreciated. Thanks, Dwayne.
Reply
Answers (
0
)
Event Firing
Get cpu load of spesific proccess