PDA

View Full Version : How to get domain controller name



buntonn
10-13-2003, 07:56 AM
Anyone know how I can get the name of the domain controller of the domain the workstation is connect to?

I need this so I can automatically add the user to a security group on the server.

Unormal
10-13-2003, 12:34 PM
You could write an external DLL wrapper for calls to the Win32 API functions NetGetDCName(), NetGetAnyDCName() or DsGetDcName()...

Stephan
10-14-2003, 11:17 AM
What about the env var LOGONSERVER?

Stephan
10-14-2003, 11:22 AM
Originally posted by Unormal
You could write an external DLL wrapper for calls to the Win32 API functions NetGetDCName(), NetGetAnyDCName() or DsGetDcName()...

Or just prototype them and use them directly in the script.

HTH,
Stephan