Re: How to add/remove local users on a remote machine

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 05/15/04

  • Next message: R.Wieser: "Re: (winsock) send 1024 bytes once, but receive 4 bytes each time, why?"
    Date: Sat, 15 May 2004 16:45:14 -0500
    
    

    Remember that he's cross-posted to m.p.active.directory.interfaces and
    m.p.adsi.general as well. These newsgroups tend to be pretty agnostic to
    API (COM/ADSI, .NET, LDAP, LDIF, etc. are all welcome) and are the
    appropriate newsgroups to ask S.DS questions.

    That said, his problem is related to delegating security context which might
    be hard to get to work with ADSI/S.DS. But maybe if you know a WMI way to
    do this that doesn't require a domain or forest trust to the remote machine,
    that might be the answer. This would not be too hard for him to translate
    into .NET using the System.Management namespace.

    Any ideas?

    Joe K.

    "Björn Holmgren" <bjohol@hotmail.com> wrote in message
    news:eH382XlOEHA.640@TK2MSFTNGP12.phx.gbl...
    > System.DirectoryServices.DirectoryEntry? Isn't that from the .NET
    framework?
    >
    > While I could easily provide some code that uses API calls (or ADSI, or
    WMI)
    > to create a local user on any remote machine, I feel doing so would be
    > meaningless if you're using VB.NET.
    >
    > Most people here are using "classic" VB versions (6 and below), and in
    fact,
    > the microsoft.public.vb.* newsgroups are for classic VB only. VB.NET
    > questions should be asked in a group with the word "dotnet" in its name.
    >
    > You may start by posting your question to
    > news:microsoft.public.dotnet.languages.vb
    >
    >
    >
    > --
    > Björn Holmgren
    > Guide Konsult AB
    > "Lasse F. Pedersen" <lassefpedersen@REMaas.FOOnja.BARdk> skrev i
    meddelandet
    > news:uzOX%233NOEHA.3964@TK2MSFTNGP10.phx.gbl...
    > > 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
    > >
    > >
    >
    >


  • Next message: R.Wieser: "Re: (winsock) send 1024 bytes once, but receive 4 bytes each time, why?"

    Relevant Pages

    • How to add/remove local users on a remote machine
      ... remote machine, and one for removing a local user on a remote machine. ... How do I create a local user on a remote machine which is not a member of my ...
      (microsoft.public.vb.winapi.networks)
    • Re: How to add/remove local users on a remote machine
      ... > 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'm getting a "General> access denied error." ... > 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. ...
      (microsoft.public.vb.winapi.networks)
    • Re: RPC for detecting Windows 64 bit OS
      ... I am trying to detect if a remote machine has 64bit Windows OS or not. ... I know there is IsWow64Process api but the process using this api has to ... I can use the remote registry APIs or SCM APIs to ...
      (microsoft.public.win32.programmer.kernel)
    • Re: query name of user who opened a file?
      ... NetFileEnum API. ... you can even force the server service to relinquish open ... NetFileClose is also a strong argument ... file that has just been closed on the remote machine. ...
      (microsoft.public.win32.programmer.kernel)
    • RPC for detecting Windows 64 bit OS
      ... I am trying to detect if a remote machine has 64bit Windows OS or not. ... I know there is IsWow64Process api but the process using this api has to be ... I would like to know if there is any special registry key or ...
      (microsoft.public.win32.programmer.kernel)