IT tutorials
 
Technology
 

Windows Server 2008 : Manipulating Active Directory with Visual Basic Scripts (part 2) - Modifying the Tombstone Lifetime

9/30/2013 3:34:32 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

You can use the following script to set the tombstone lifetime. This script sets the tombstone lifetime to 365, but you can change the number 365 in the script to any number desired.

Note

The tombstone lifetime identifies the maximum age of a deleted object before it is permanently deleted. Tombstoned objects can be authoritatively restored. However, once the tombstone lifetime expires, they can no longer be restored.


set objdom = getobject("LDAP://rootdse")
set objds = getobject("LDAP://cn=directory service,cn=windows nt,"
& "cn=Services," & objdom.get("configurationnamingcontext") )
objds.put "tombstonelifetime",365
objds.setinfo

Note

Notice that the second line spans two lines but should only be entered as a single line.


The following table explains each of these lines.

Creating an OUComments
set objdom = getobject("LDAP://
rootdse")

This line sets the context to the domain used by the computer using the rootdse shortcut. You can use this instead of naming the domain. The benefit is that the script is portable to any domain.

Note

LDAP must be all uppercase.

set objds = getobject("LDAP://
cn=directory service,cn=windows
nt," & "cn=Services," &
objdom.get
("configurationnamingcontext") )

This command uses the getobject method to connect to the directory services container. Figure 1 shows the directory services container in the adsiedit tool.
objds.put "tombstonelifetime",365You can assign values to properties with the put method. This line sets the value of the tombstone lifetime property to 365. Figure 1 shows the current value as 180.
objou.setinfoThe setinfo method makes the change.

Figure 1. ADSI Edit tool

You can use the following steps to view the ADSI Edit tool on a domain controller.

StepComments
1.Click Start, type ADSI Edit, and double-click ADSI Edit in the Programs list.
2.Right-click ADSI Edit and select Connect to.
3.In the Connection Point section, Ensure that Select a Well Known Naming Context is selected. Select Configuration from the drop down menu. Click OK.
4.Select Configuration and expand it by clicking the plus (+).
5.Select CN=Configuration and expand it.
6.Select CN=Services and expand it.
7.Select CN=Windows NT and expand it.
8.Select CN=Directory Service. Right-click CN=Directory Service and select Properties.
9.Scroll down to Tombstone Lifetime to view the value.

Note

You can double-click it to set the value from here.
 
Others
 
- Windows Server 2008 : Manipulating Active Directory with Visual Basic Scripts (part 1)
- InfoPath with SharePoint 2010 : Enhancing the User Experience - Use Pictures as Choices
- InfoPath with SharePoint 2010 : Enhancing the User Experience - Create a Tabbed Navigation in Your Form
- InfoPath with SharePoint 2010 : Enhancing the User Experience - Make Screen Tips Informative for Validation, Notify the User of Successful Submission
- InfoPath with SharePoint 2010 : Enhancing the User Experience - Configure Dynamic Sections
- InfoPath with SharePoint 2010 : Enhancing the User Experience - Display a Read-Only Value
- Windows 7 : Using a Windows Network - Sharing Resources (part 2) - Sharing Folders Independently
- Windows 7 : Using a Windows Network - Sharing Resources (part 1) - Sharing with a Homegroup
- Windows 7 : Using a Windows Network - Network Power User Topics (part 2) - Mapping Drive Letters
- Windows 7 : Using a Windows Network - Network Power User Topics (part 1) - Understanding the UNC Naming Convention
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us