Urgent!!!!!!!!!!!!!

  • Thread starter Thread starter chen jin cai via DotNetMonster.com
  • Start date Start date
C

chen jin cai via DotNetMonster.com

Dear Sir:

I attempt to add member(s) to or delete member(s) from one new group(created by me ,which is similar to ? Administrators? and ?Power Users? in localgroup which in my computer) by VB.NET,there are my codes
to list the member(s) from one group in my computer,as follows:
Dim Group
Dim User

Group = GetObject("WinNT://mis-cjc/accessform")

For Each User In Group.Members
Console.WriteLine(User.Name)
Next
"mis-cjc" is my computer' name ,and "accessform" is a new group created by me.
Now,I want to add or remove.
Can you help me?



Thank you!

Best wishes!







2005-1-13
 
This is a hack
...but you can SHELL a command to do this for you. In other words, you could have a .bat file that you would pass the name and option (add or delete)
The actual commandline would look something like this or a variation of:

For Adding
Net Localgroup "Users" "<domain>\<name>" /Add

or for Removal
Net Localgroup "Users" "<domain>\<name>" /Delete

You can also check out this source...
http://www.15seconds.com/issue/980316.htm


Robert Schoen (Microsoft Visual Basic QA)
--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
--------------------
From: "chen jin cai via DotNetMonster.com" <[email protected]>
Subject: Urgent!!!!!!!!!!!!!
Date: Thu, 13 Jan 2005 00:59:23 GMT
Organization: http://www.DotNetMonster.com
Message-ID: <[email protected]>
X-Abuse-Report: http://www.DotNetMonster.com/Uwe/NB/Abuse.aspx
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 178.67-18-207.reverse.theplanet.com 67.18.207.178
Lines: 1
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:253479
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Dear Sir:

I attempt to add member(s) to or delete member(s) from one new group(created by me ,which is similar to ? Administrators? and ?Power Users? in
localgroup which in my computer) by VB.NET,there are my codes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top