Results 1 to 6 of 6

Thread: How to delete Computer Object in AD

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    2

    Cool How to delete Computer Object in AD

    Hello guys,

    I am trying to write a Function, which provide a option to delete computer objects in ad. But i do not find any working code via google. Can you help me how i can delete a computer object in ad with vb.net? Note that i must do this with another user, than the one which is logged on on the PC where the code will be executed. So i must give user credentials within the function.

    I hope you guys can help me,
    thanks a lot!

    Greetings

  2. #2
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    864

    Re: How to delete Computer Object in AD

    Hi,

    to help people to help you, maybe you should explain AD before using it.

    Furthermore just getting another users credentials is not possible, running something as administrator is possible if a user has enough rights to do so.

    It's possible to have some credentials in your Active Directory (AD) you can use to delete these objects with the propper right.
    Last edited by Dnereb; Mar 11th, 2015 at 02:49 AM. Reason: Just got what AD is.
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    2

    Re: How to delete Computer Object in AD

    Quote Originally Posted by Dnereb View Post
    Hi,

    to help people to help you, maybe you should explain AD before using it.

    Furthermore just getting another users credentials is not possible, running something as administrator is possible if a user has enough rights to do so.

    It's possible to have some credentials in your Active Directory (AD) you can use to delete these objects with the propper right.
    Hey dnereb thanks a lot for your reply!
    I already now, that it is not possible to get an other userīs credentials and that it is possible to edit objects in active directory, if right is given.
    But i need a Snippet for Vb.net(2010), which provides me code to delete a comptuer object in Active Directory and to do this with another
    user credentials, which i can store in the same function (as variable for example).

    Thanks,
    greetings

  4. #4
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,615

    Re: How to delete Computer Object in AD

    StackOverflow has an example here.http://stackoverflow.com/questions/1...unts-within-ad

    It doesn't allow you to do so with another user's credentials and I'd be very surprised if that's possible at all. It would represent a massive hole in the security model. As Dnereb said, you could run could run with elevated permissions as an administrator but spoofing another user is almost certainly blocked.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  5. #5
    New Member
    Join Date
    Jun 2011
    Posts
    11

    Re: How to delete Computer Object in AD

    IT's a big security risk though but if you want to do it that way it can be done

    I have done almost this from VBscript there the local admin is logged on during installation and I had to put the computer into AD groups, the bad thing is that I don't have the script right here.
    The trick is to create an LDAP connection to AD with the credentials you would like to use.

  6. #6
    New Member
    Join Date
    Jun 2011
    Posts
    11

    Re: How to delete Computer Object in AD

    A quick google says it's opendsobject you want to have a look at.

    The better way to solve it if the users are in the same domain is to create an AD security group and give that group the proper permissions to delete the computer accounts. Just add the right users to the newly created group and they can now delete the computer accounts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width