How to add/remove local users on a remote machine
From: Lasse F. Pedersen (lassefpedersen_at_REMaas.FOOnja.BARdk)
Date: 05/13/04
- Previous message: S Shulman: "Default diaup connection"
- Next in thread: Björn Holmgren: "Re: How to add/remove local users on a remote machine"
- Reply: Björn Holmgren: "Re: How to add/remove local users on a remote machine"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 13:32:36 +0200
Hello,
I have a class with a couple of functions, one for adding a local user on a
remote machine, and one for removing a local user on a remote machine. I
need to be able to do this. Each takes the name of the remote machine, a
username (remote machine administrator), a matching password, and some
details about the user to add/remove as arguments.
In each function I'm using System.DirectoryServices.DirectoryEntry to
connect to the given machine with the username and password specified, and
supposing that these are in effect, I go from there...
However! When I reach the point where I have to, in the add user function -
for example, commit my changes to the new user entry (which was obtained
from machineEntry.Children.Add(new_of_new_user)), I'm getting a "General
access denied error."
My question is:
How do I create a local user on a remote machine which is not a member of my
domain?
I've tried using LogonUser and impersonation, but since most of the remote
machines I need to access are not a member of the same domain as mine, that
does not seem to be working for me either.
Thanks,
Lasse
- Previous message: S Shulman: "Default diaup connection"
- Next in thread: Björn Holmgren: "Re: How to add/remove local users on a remote machine"
- Reply: Björn Holmgren: "Re: How to add/remove local users on a remote machine"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|