开发者

Obtain the domain name on a workstation or server

开发者 https://www.devze.com 2022-12-09 16:33 出处:网络
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.

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

精彩评论

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