S Garratt
2005-01-28 16:21:03 UTC
I've created a group and delegated authority to it to Delete Computer Objects
and Delete child objects of computer objects and I've put a user account into
the group. To test it, I've started AD Users & Computers using Runas with
the user account and I've been able to delete a computer account.
I have a problem with this code:
Dim computerAccount As New DirectoryEntry("LDAP://" & _
distinguishedNameValue, _
deleteComputerAccountUser, _
deleteComputerAccountPassword)
Try
computerAccount.DeleteTree()
etc.
where distinguishedNameValue, deleteComputerAccountUser &
deleteComputerAccountPassword are exactly what they sound like.
When I use the account referred to above, the code returns an "Access is
denied" error. When I substitute in my Domain Admin credentials, it works
fine.
and Delete child objects of computer objects and I've put a user account into
the group. To test it, I've started AD Users & Computers using Runas with
the user account and I've been able to delete a computer account.
I have a problem with this code:
Dim computerAccount As New DirectoryEntry("LDAP://" & _
distinguishedNameValue, _
deleteComputerAccountUser, _
deleteComputerAccountPassword)
Try
computerAccount.DeleteTree()
etc.
where distinguishedNameValue, deleteComputerAccountUser &
deleteComputerAccountPassword are exactly what they sound like.
When I use the account referred to above, the code returns an "Access is
denied" error. When I substitute in my Domain Admin credentials, it works
fine.