Friday, December 16, 2011

Boot-Repair

If Windows power management is bad, Ubuntu's is even worse.  I have two computers which are unfortunate enough to run on Intel Graphics.  The graphics cards on both failed to resume after they went to sleep.

One way to fix it is to edit the GRUB options.  You can do it the hard way by looking up options for GRUB and editing the GRUB setting file.  Alternatively, there is a graphical utility to make you life easier.

https://help.ubuntu.com/community/Boot-Repair

Friday, December 2, 2011

Retrieving personal details from Active Directory

If you are programming in C#, you can access information held on Active Directory easily using the code below.

Below uses the libraries provided in DirectoryServices namespace to query the Active Directory such as a user's telephone number, email address, etc.  As you can see, it is very straight forward (at least compared with tutorials I have seen using LDAP)

<% System.DirectoryServices.DirectoryEntry directoryEntry
= principal.GetUnderlyingObject() as
System.DirectoryServices.DirectoryEntry; %>


<%: principal.DisplayName %>

Tel: <%: directoryEntry.Properties["telephoneNumber"].Value%>

Email: <%: directoryEntry.Properties["mail"].Value%>


Although it looks like classes in DirectoryServices are wrappers to equivalent LDAP calls, it is certainly a lot cleaner and easier to understand (in my opinions)

The full list of properties you can retrieve can be found on