G
Guest
I am trying to write a program in VB.NET to work with Active Directory user accounts in my Win2K domain. I found sample code as shown below but when I add it to a project it says "Type IADsContainer is not defined" and "Type IADsUser is not defined". What is wrong? Am I missing a reference or something else?
Example: Creating a User Object (Visual Basic)
Dim Container as IADsContainer
Dim NewUser as IADsUser
‘ Bind to the known container.
Set Container = GetObject("WinNT://MSFT")
‘ Create the new Active Directory Service Interfaces User.
Set NewUser = Container.Create("User", "Jane")
‘ Set Jane’s password.
NewUser.AccountRestrictions.SetPassword("Argus")
‘ Complete the operation to create the object in the directory.
NewUser.SetInfo
Example: Creating a User Object (Visual Basic)
Dim Container as IADsContainer
Dim NewUser as IADsUser
‘ Bind to the known container.
Set Container = GetObject("WinNT://MSFT")
‘ Create the new Active Directory Service Interfaces User.
Set NewUser = Container.Create("User", "Jane")
‘ Set Jane’s password.
NewUser.AccountRestrictions.SetPassword("Argus")
‘ Complete the operation to create the object in the directory.
NewUser.SetInfo