Microsoft KB Archive/295758

{|
 * width="100%"|

HOWTO: Use Visual Basic Script to Clear SidHistory

 * }

Q295758

-

The information in this article applies to:


 * Microsoft Active Directory Service Interfaces, version 2.5
 * Microsoft Windows 2000 Server

-

SUMMARY
The Microsoft Visual Basic Script (VBScript) provided in this article will find an object by its name in the directory and attempt to clear the sidHistory for that object. It has optional parameters for objectClass and objectCategory to help in the search.

MORE INFORMATION
When a user object moves from one domain to another, a new security identifier (SID) must be generated for the user account and stored in the Object-SID property. Before the new value is written to the property, the previous value is copied to another property of a User object, SID-History (sidHistory). This property can hold multiple values. Each time a User object moves to another domain, a new SID is generated and stored in the Object-SID property and another value is added to the list of old SIDs in SID-History. Sometimes it may be necessary to clear the sidHistory.

The following VBScript code will remove the sidHistory attribute from the directory object specified in the command line arguments.

 Open Microsoft Notepad. Copy the following code and paste it into your Notepad document. Save the document as C:\ClearSidHistory.vbs  Run the code. Usage for ClearSidHistory.vbs is as follows: cscript.exe ClearSidHistory.vbs -n=  [-o=] [-c=]

-n=

-o=

-c=

Examples:

cscript.exe ClearSidHistory.vbs -n=My Contact

cscript.exe ClearSidHistory.vbs -n=Computer1 -o=computer

cscript.exe ClearSidHistory.vbs -n=James Smith -o=Person -c=user 

Additional query words:

Keywords : _IK kb32bitOnly

Issue type : kbhowto kbprb

Technology : kbwin2000Serv kbwin2000ServSearch kbwin2000Search kbAudDeveloper kbADSISearch kbADSI250