Jump to content
Sign in to follow this  
mbouchard

Determine Domain membership

Recommended Posts

mbouchard

I am trying to figure out how to determine if a PC is a member of a domain or not while logged in as the local Administrator. So, @LogonDNSDomain, @LogonDomain, and @LogonServer would not work as it reports the local computer name.

Thanks,

Mike

Share this post


Link to post
Share on other sites
Joon

I don't know AutoIt well enough to make API call. But you can use NetGetJoinInformation in NETAPI32.DLL to get the join status. It returns 1 for Workgroup and 2 for Domain.

Good luck.

Share this post


Link to post
Share on other sites
mbouchard

excerpt from one of my scripts...

$sDefaultDomain = RegRead("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Domain")
Thanks, works for what I needed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×