Mark Minasi's Tech Forum
Register Calendar Latest Topics Chat
 
 
 


Reply
  Author   Comment  
jsclmedave

Administrator
Registered:
Posts: 414
Reply with quote  #1 
Turns out someone messed with permissions  Once they reset the permissions from the OU down this error went away.


Code:


PS C:\Users\prvddubinsk\Desktop>> get-adcomputer -filter {Enabled -eq "False"} -searchbase "OU=Stale,DC=Really,DC=Big,DC=Dog,DC=net" | Remove-ADObject -Recursive
Remove-ADObject : Access is denied
At line:1 char:102
+ ... =Dog,DC=net"" | Remove-ADObject -Recursive
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (CN=SERVER03,O...1,DC=Dog,DC=net:ADComputer) [Remove-ADObject], UnauthorizedAccessException
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.UnauthorizedAccessException,Microsoft.ActiveDirectory.Management.Commands.RemoveADObject 


__________________
Tim Bolton @jsclmedave
Email: [string](0..20|%{[char][int](32+('527377347976847978324785847679797514357977').substring(($_*2),2))}) -replace ' '  

New to the forum? Please Read this
0
Pieter

Avatar / Picture

Senior Member
Registered:
Posts: 130
Reply with quote  #2 
Maybe the 'Protect from accidental deletion' is enabled ?  See Properties, tab |Object|.
__________________
Pieter Demeulemeester
0
jsclmedave

Administrator
Registered:
Posts: 414
Reply with quote  #3 
Quote:
Originally Posted by Pieter
Maybe the 'Protect from accidental deletion' is enabled ?  See Properties, tab |Object|.


Thats where I looked first and then the old Run As Admin but we still got the access error.  Once they reset the permissions on the OU it all worked...

__________________
Tim Bolton @jsclmedave
Email: [string](0..20|%{[char][int](32+('527377347976847978324785847679797514357977').substring(($_*2),2))}) -replace ' '  

New to the forum? Please Read this
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: