JCL Help:GetUserDomainName

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the name of the domain where a user account resides.


Pascal

 function GetUserDomainName(const CurUser: string): string;


Parameters

Parameters Description
const CurUser: string The name of the user account to look up.


Return Value

As the result, you will receive the name of the domain the user is defined in, or an empty string if the function fails.


Description

GetUserDomainName returns the name of the domain where a user account resides. Under Win9x/ME, an empty string will be returned.


See Also

GetDomainName GetLocalUserName


About

Unit

JclSysInfo


Donator

Peter Friese


Notes

The function tries to find the user account on the local system first. Next, the primary domain is checked. If the name is not found there, trusted domains are checked. GetUserDomainName relies on LookupAccountName, which is not implemented by Win9x/ME, and will return an empty result string on these platforms.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page