|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add Active Directory Users to a Group on a WorkstationFound the following on Microsoft's website,
http://support.microsoft.com/kb/306271, but it only seems to work when creating an account on a workstation. I am new to VB.NET (2005). TIA! Show quoteHide quote ://Bill are you asking to do it remotely?
<whoo***@gmail.com> wrote in message Show quoteHide quote news:1166812387.036004.126870@h40g2000cwb.googlegroups.com... > Found the following on Microsoft's website, > http://support.microsoft.com/kb/306271, but it only seems to work when > creating an account on a workstation. I am new to VB.NET (2005). > > TIA! > > ://Bill > Examples of both would be great, but locally is what I am looking for.
://Bill vbnetdev wrote:Show quoteHide quote > are you asking to do it remotely? > > > <whoo***@gmail.com> wrote in message > news:1166812387.036004.126870@h40g2000cwb.googlegroups.com... > > Found the following on Microsoft's website, > > http://support.microsoft.com/kb/306271, but it only seems to work when > > creating an account on a workstation. I am new to VB.NET (2005). > > > > TIA! > > > > ://Bill > > Then I don't understand. The MS example should work for you locally.
what happens when you try? <whoo***@gmail.com> wrote in message Show quoteHide quote news:1166816530.574041.251680@79g2000cws.googlegroups.com... > Examples of both would be great, but locally is what I am looking for. > > > ://Bill > > vbnetdev wrote: >> are you asking to do it remotely? >> >> >> <whoo***@gmail.com> wrote in message >> news:1166812387.036004.126870@h40g2000cwb.googlegroups.com... >> > Found the following on Microsoft's website, >> > http://support.microsoft.com/kb/306271, but it only seems to work when >> > creating an account on a workstation. I am new to VB.NET (2005). >> > >> > TIA! >> > >> > ://Bill >> > > THe following is my code which doesn't work:
Sub Main() Dim AD As DirectoryEntry = New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim grp As DirectoryEntry grp = AD.Children.Find("Administrators", "group") If grp.Name <> "" Then Console.WriteLine("Going to add to group") grp.Invoke("Add", New Object() {"<domain>\<user>"}) ElseConsole.WriteLine("Group does not exist") End If End Sub Debugging says: System.Reflection.TargetInvocationException was unhandled Thanks for working with me! What line did the error occured?
what does bump mean? <whoo***@gmail.com> wrote in message Show quoteHide quote news:1166835510.700003.312640@f1g2000cwa.googlegroups.com... > Bump... > > What am I doing wrong?? > Dump just meant that I am trying to keep the post alive, hoping someone
else may see it. It's erroring out at grp.Invoke("Add", New Object() {"<domain>\<user>"}) Show quoteHide quote ://Bill
Other interesting topics
How I can find out on which platform I am running (32/64 bits)?
Why not use DAO? your favorite VB 2005 book? Make inherited property invisible mouse right click Form Focus Windows Service to copy files to a Mapped Drive schema.ini Pipe Delimited to Access Database change date getting 2005 grid to look like 2003 |
|||||||||||||||||||||||