Friday, February 13, 2009

Unable to initialise admin dll (OSEnv)

You may see the following message,

"Unable to initialize admin dll (OSEnv)" or "Unable to gather user rights"

when starting Server Manager if a change has been made to any domain the user is a member of or if one of them has been deleted.

It may also be the result of connectivity problems where a domain is unavailable and the error can be caused by varying problems with the domain.

Check the possible domains the user is a member of has been modified, deleted or is unavailable.

Our code calls the Microsoft function GetComputerName() which is supposed to return the NetBIOS name of the local computer. See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getcomputername.asp.

Once it has the name, it uses it to call NetServerEnum() (another Microsoft call) to get the domain controllers for the computer's domain. See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netserverenum.asp.

If these functions fail, then an error is returned and the unable to gather user rights message is displayed.