473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Adding Domain user to a local group

I am trying to create a small app using visual studio 2005 (vb), and I want
to be able to input the users name and add the domain user to the local
remote desktop user group. Here is the code I have so far.

Dim LCL As New DirectoryEntry
Dim DOM As New DirectoryEntry
Dim DOMUSR As DirectoryEntry
Dim LCLGRP As DirectoryEntry

LCL = "WinNT://" & "PCNAME" & ",computer"
DOM = "WinNT://domain"
DOMUSR = DOM.Children.Find("USERID", "user")
LCLGRP = LCL.Children.Find("LOCAL_GROUP", "group")

LCLGRP.Invoke("Add", New Object() {DOMUSR.Path.ToString})

when I debug this I get the follow error on all four dim statements

Error 1 Type 'DirectoryEntry' is not defined.

Mar 29 '07 #1
0 961

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RobinB | last post by:
We gave created a web application that uses AD for authorization and authentication. The application can be used by domain users as well as the general public. What we currently have is 2 domains...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm having a problem with reading user groups on Active Directory using C#. It returns all the groups in the Universal scope for a specific user. However, I only need the groups in...
1
by: Ching-Lung | last post by:
Hi, Is there any way to add new user to local admin group in C# ASP.NET? Thanks, -CL
1
by: Paul | last post by:
Hi all, Thanks in advance for your help. I would like to know how to add a computer to a domain, and a domain user to a local group. Cheers Paul
5
by: Rocky | last post by:
Hi, I have a webform, with 2 textboxs and a submit button. In the text box1, i enter a username and in textbox2 I enter the computer name. Both the username and computer name is in active...
0
by: andres | last post by:
Can anyone suggest how to get the local and domain members from a local group. The C# code is running from an ASP.NET 2.0 webpage. The following code only returns the local members and not the...
0
by: el dio | last post by:
Hi, i'm trying to add domain user to a local Windows group. Imagine I have domain 'myDomain', domain user 'myDomain\domainUser', my computer is 'myComputer', local group is 'Guests'. I used...
0
by: Chad Dressler | last post by:
I'm trying to use System.DirectoryServices to add a domain user to a local group via a web application which runs under the identity of a local admin account. Is this possible? I can...
5
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.