Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get fully qualified domain name in vba
I have the api calls to get the username, servername and domainname but when
I call the NetWkstaUserGetInfo API specifying a level 1 information structure into the following type declaration the wkui1_logon_domain only returns the first characters. For example, I get 'HQ' instead of 'HQ.ABCCO.COM'. Thanks for your help. ....rick Private Type WKSTA_USER_INFO_1 'name of the user currently logged onto the workstation. wkui1_username As Long 'domain name of the user account currently logged on wkui1_logon_domain As Long 'list of other domains browsed by the workstation wkui1_oth_domains As Long 'name of the authenticating server wkui1_logon_server As Long End Type .... Dim typNTInfo As WKSTA_USER_INFO_1 'call the NetWkstaUserGetInfo API specifying a level 1 information structure lngRet = apiWkStationUser(0&, 1&, lngPtr) If lngRet = NERR_Success And lngPtr Then Call sapiCopyMemory(typNTInfo, ByVal lngPtr, LenB(typNTInfo)) If Not IsNull(lngPtr) Then With typNTInfo glbUserName = fStringFromPtr(.wkui1_username) glbDomainName = fStringFromPtr(.wkui1_logon_domain) glbServerName = fStringFromPtr(.wkui1_logon_server) glbOtherDomains = fStringFromPtr(.wkui1_oth_domains) End With End If End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. | Excel Programming | |||
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. | Excel Programming | |||
Bring Back Qualified Sum from another WB | Excel Worksheet Functions |