Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Computer to a Domain

Status
Not open for further replies.

Denz

Technical User
Oct 29, 2001
33
0
0
GB
Hi All,

I was wondering if it was possible to get VB to add a computer to a domain as is you were doing it through the network properites dialog?

Thanks

David
 
There is an API that will do it for you
Code:
Declare Function NetJoinDomain Lib "NETAPI32.dll" ( _ 
	 ByVal lpServer As String, _ 
	 ByVal lpDomain As String, _ 
	 ByVal lpAccountOU As String, _ 
	 ByVal lpAccount As String, _ 
	 ByVal lpPassword As String, _ 
	 ByVal fJoinOptions As Long) As Long
However, it is windows 2000 or higher


Look it up in MSDN for full info, as I have never used it

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Thanks Matt,

I'll give that a try!

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top