Whats wrong with this command???
-
Thursday, June 21, 2012 4:18 PM
I am trying to restore object and can find it but it wont restore! If i search by name or display name i get similar error in first place but with samaccountname i can locate it but cant restore. I tried LDAP method and got error there too of different kind.
PS C:\Users\administrator.domain> Get-ADObject -Filter {samaccountname -eq
"XenTmplt$"} -IncludeDeletedObjects
Deleted : True
DistinguishedName : CN=XENTMPLT\0ADEL:e51eef47-02ba-40c7-acb9-fea3f9a0af7b,CN=D
eleted Objects,DC=domain,DC=local
Name : XENTMPLT
DEL:e51eef47-02ba-40c7-acb9-fea3f9a0af7b
ObjectClass : computer
ObjectGUID : e51eef47-02ba-40c7-acb9-fea3f9a0af7bPS C:\Users\administrator.domain> Get-ADObject -Filter {samaccountname -eq
"XenTmplt$"} -IncludeDeletedObjects | Restore-ADObject
Restore-ADObject : Illegal modify operation. Some aspect of the modification is
not permitted
At line:1 char:96
+ Get-ADObject -Filter {samaccountname -eq "XenTmplt$"} -IncludeDeletedObjects
| Restore-ADObject <<<<
+ CategoryInfo : InvalidOperation: (CN=XENTMPLT\0AD...lacorp,DC=l
ocal:ADObject) [Restore-ADObject], ADIllegalModifyOperationException
+ FullyQualifiedErrorId : 0,Microsoft.ActiveDirectory.Management.Commands.
RestoreADObject
All Replies
-
Thursday, June 21, 2012 7:21 PM
Hi,
have you enabled the Active Directory trash?
http://technet.microsoft.com/en-us/library/dd379481(v=WS.10).aspx
regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
-
Thursday, June 21, 2012 9:22 PM
Is it possible there is another object with the same cn in the lastKnownParent, or with the same sAMAccountName anywhere in the domain?
Richard Mueller - MVP Directory Services
-
Friday, June 22, 2012 5:25 AMModerator
Hi,
I would like to know that have you enable AD Recycle Bin.
The below blog is talk about this, please go through it, you will find out the proper way to restore deleted objects:
The AD Recycle Bin: Understanding, Implementing, Best Practices, and Troubleshooting
Hope this helps.
Regards,
Yan Li
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
Yan Li
TechNet Community Support
- Proposed As Answer by Yan Li_Microsoft Contingent Staff, Moderator Monday, June 25, 2012 9:55 AM
- Marked As Answer by Yan Li_Microsoft Contingent Staff, Moderator Wednesday, June 27, 2012 11:17 AM

