开发者

Obtain the domain name on a workstation or server

Some systems don't have a domain name configured or they might have something in the form of domain.local; yet they are located within a domain.

Is there a 开发者_如何学运维way to get the domain these system belong to?

I already tried using the classic APIs:

NetWkstaGetInfo() DnsQueryConfig()

and many others...

Code is appreciated.


Try GetComputerNameEx()

GetComputerNameEx(ComputerNameDnsDomain, pszBuffer, &dwLength)


getdomainname()

Sorry just noticed the windows tag, see list of network functions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜