Script for enable adrecycle bin in Windows 2008R2

Using this small script we can easily enable the active directory recycle bin feature in windows 2008r2.we have to copy the code to text editior and save it as a powershell script format(ps1).

 

 

 

Import-Module ActiveDirectory
$strforestname=(Get-AdForest).name
Enable-AdoptionalFeature ‘Recycle Bin Feature’ -Scope ForestOrconfigurationSet -Target $strforestname

 

*note-Remember to set the execution policy before running any of the powershell script(refer the below link)

http://technet.microsoft.com/en-us/library/ee176961.aspx

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.