你目前正处于脱机状态,正在等待 Internet 重新连接

Dltpurge.vbs 的 Microsoft 知识库文章 Q312403 为的文本版本

针对 Windows XP 的支持已终止

Microsoft 已于 2014 年 4 月 8 日终止了针对 Windows XP 的支持。该更改已影响到您的软件更新和安全选项。 了解这一措施对于您的含义以及如何继续保持受保护状态。

针对 Windows Server 2003 的支持已于 2015 年 7 月 14 日终止。

Microsoft 已于 2015 年 7 月 14 日终止了对于 Windows Server 2003 的支持。该更改已影响到您的软件更新和安全选项。 了解这一措施对于您的含义以及如何继续保持受保护状态。

注意:这篇文章是由无人工介入的微软自动的机器翻译软件翻译完成。微软很高兴能同时提供给您由人工翻译的和由机器翻译的文章, 以使您能使用您的语言访问所有的知识库文章。然而由机器翻译的文章并不总是完美的。它可能存在词汇,语法或文法的问题,就像是一个外国人在说中文时总是可能犯这样的错误。虽然我们经常升级机器翻译软件以提高翻译质量,但是我们不保证机器翻译的正确度,也不对由于内容的误译或者客户对它的错误使用所引起的任何直接的, 或间接的可能的问题负责。

点击这里察看该文章的英文版: 315229
概要
可以在 Windows 中使用分布式链接跟踪服务以跟踪跨 NTFS 格式化的卷和服务器的创建和链接的文件的移动。本文包含以下 Microsoft 知识库文章中所述 Dltpurge.vbs 脚本的文本版本:
312403分布式链接跟踪在基于 Windows 2000 的域控制器上
更多信息
要使用此脚本,请执行以下操作:
  1. 复制所有 < 开始复制此 > 之间文本的标记和在 < 复制此处结束 > 标记此本文,然后粘贴到一个 ASCII 文本编辑器文件 (例如对于 Microsoft 记事本文件) 的文本。
  2. 将文件另存为"Dltpurge.vbs"。
  3. 完成下面的 Microsoft 知识库文章中描述的过程:
    312403分布式链接跟踪在基于 Windows 2000 的域控制器上
<从这里开始复制 >
'=============================================================================='=============================================================================='' Copyright (C) 2001 by Microsoft Corporation.  All rights reserved.'' This script deletes all Active Directory objects used by the' Distributed Link Tracking Server service.'' It is assumed that the DLT Server service has been disabled,' and you wish to recover the DIT space these objects occupy.'' Usage:   cscript DltPurge.vbs <options>' Options: -s ServerName'          -d distinguishedname dc=mydomain,dc=mycompany,dc=com'          -b BatchSize  BatchDelayMinutes'          -t (optional test mode)'' The objects are deleted in batches - BatchSize objects are deleted,' then there is a BatchDelayMinutes delay before the next batch.''=============================================================================='==============================================================================Option Explicit'' Globals, also local to main.'Dim oProviderDim oTargetDim sServerDim sDomainDim bTestDim BatchSizeDim BatchDelayMinutes'' Set defaults'BatchSize = 1000BatchDelayMinutes = 15bTest = False'==============================================================================''   ProcessArgs''   Parse the command-line arguments.  Results are set in global variables'   (oProvider, oTarget, sServer, sDomain, BatchSize, and BatchDelayMinutes).''==============================================================================public function ProcessArgs    Dim iCount    Dim oArgs    on error resume next    '    ' Get the command-line arguments    '        Set oArgs = WScript.Arguments    if oArgs.Count > 0 then        '        ' We have command-line arguments.  Loop through them.        '        iCount = 0        ProcessArgs = 0        do while iCount < oArgs.Count            select case oArgs.Item(iCount)                '                ' Server name argument                '                                case "-s"                    if( iCount + 1 >= oArgs.Count ) then                        Syntax                        ProcessArgs = -1                        exit do                    end if                    sServer = oArgs.Item(iCount+1)                    if Len(sServer) > 0 then sServer = sServer & "/"                    iCount = iCount + 2                '                ' Enable testing option                '                                case "-t"                    iCount = iCount + 1                    bTest  = True                '                ' Domain name option                '                                case "-d"                    if( iCount + 1 >= oArgs.Count ) then                        Syntax                        ProcessArgs = -1                        Exit Do                    end if                    sDomain = oArgs.Item(iCount+1)                    iCount = iCount + 2                '                ' Batching option (batch size, batch delay)                '                case "-b"                    if( iCount + 2 >= oArgs.Count ) then                        Syntax                        ProcessArgs = -1                        exit do                    end if                    Err.Clear                                        BatchSize = CInt( oArgs.Item(iCount+1) )                    BatchDelayMinutes = CInt( oArgs.Item(iCount+2) )                                        if( Err.Number <> 0 ) then                         wscript.echo "Invalid value for -b argument" & vbCrLf                        Syntax                        ProcessArgs = -1                        exit do                    end if                                        iCount = iCount + 3                '                ' Help option                '                                case "-?"                    Syntax                    ProcessArgs = -1                    exit do                '                ' Invalid argument                '                                case else                                    ' Display the syntax and return an error                    wscript.echo "Unknown argument: " & oArgs.Item(iCount) & vbCrLf                    Syntax                    ProcessArgs = -1                    Exit Do                                end select      loop    else            '        ' There were no command-line arguments, display the syntax        ' and return an error.        '        Syntax        ProcessArgs = -1    end if    Set oArgs = Nothingend function ' ProcessArgs'==============================================================================''   Syntax''   Show the command-line syntax''==============================================================================public function Syntax    wscript.echo    vbCrLf & _                    "Purpose:   Delete Active Directory objects from Distributed Link Tracking" & vbCrLf & _                    "           Server service (Assumes that DLT Server has been disabled" & vbCrLf & _                    "           on all DCs)" & vbCrLf & _                    vbCrLf & _                    "Usage:     " & wscript.scriptname & " <arguments>" & vbCrLf & _                    vbCrLf & _                    "Arguments: -s Server" & vbCrLf & _                    "           -d FullyQualifiedDomain" & vbCrLf & _                    "           -b BatchSize BatchDelayMinutes (default to 1000 and 15)" & vbCrLf & _                    "           -t (optional test mode, nothing is deleted)" & vbCrLf & _                    vbCrLf & _                    "Note:      Objects are deleted in batches, with a delay between each" & vbCrLf & _                    "           batch.  The size of the batch defaults to 1000 objects, and" & vbCrLf & _                    "           the length of the delay defaults to 15 minutes.  But these" & vbCrLf & _                    "           values can be overridden using the -b option." & vbCrLf & _                    vbCrLf & _                    "Example:   " & wscript.scriptname & "  -s  myserver  -d distinguishedname dc=mydomain,dc=mycompany,dc=com "end function    ' Syntax'==============================================================================''   PurgeContainer''   Delete all objects of the specified class in the specified container.'   This subroutine is called once for the volume table and once for'   the object move table.''==============================================================================sub PurgeContainer(ByRef oParent, ByVal strClass)    dim oChild    dim iBatch    dim iTotal    On Error Resume Next    iTotal = 0    iBatch = 0    ' Loop through the children of this container    For Each oChild in oParent        '         ' Is this a DLT object?        '                if oChild.Class = strClass Then            '            ' Yes, this is a DLT object, it may be deleted            '                        iTotal = iTotal + 1            iBatch = iBatch + 1            '            ' Delete the object            '                        if bTest then                wscript.echo "Object that would be deleted: " & oChild.adspath            else                oParent.Delete oChild.Class, oChild.Name            end if            '            ' If this is the end of a batch, delay to let replication            ' catch up.            '                        if iBatch = BatchSize then                            iBatch = 0                                wscript.stdout.writeline "" ' ignored by wscript                wscript.echo "Deleted " & BatchSize & " objects"                wscript.echo "Pausing to allow processing (will restart at " & DateAdd("n", BatchDelayMinutes, Time) & ")"                                wscript.sleep BatchDelayMinutes * 60 * 1000                wscript.echo "Continuing ..."                            end if                    else                    ' oChild.Class didn't match strClass            wscript.echo "Ignoring unexpected class: " & oChild.Class                    end if        oChild = NULL    Next    wscript.echo "Deleted a total of " & iTotal & " objects"end sub ' PurgeContainer'=============================================================================='' Main''==============================================================================if (ProcessArgs=-1) then wscript.quiton error resume next'' Explain what's about to happen'wscript.stdout.writeline "" ' ignored by wscriptwscript.echo "This script will purge all objects from the Active Directory" & vbCrLf & _             "used by the Distributed Link Tracking Server service (trksvr)." & vbCrLf & _             "It is assumed that this service has already been disabled on" & vbCrLf & _             "all DCs in the domain."'' When running in cscript, pause to give an opportunity to break out' (These 3 lines are for cscript and ignored by wscript.)'wscript.stdout.writeline ""wscript.stdout.writeline "Press Enter to continue ..."wscript.stdin.readline'' Get an ADSI object'Set oProvider = GetObject("LDAP:")'' Purge the System/FileLinks/ObjectMoveTable'wscript.stdout.writeline "" ' ignored by wscriptwscript.echo "Purging ObjectMoveTable"Set oTarget = oProvider.OpenDSObject( "LDAP://" & sServer  & "cn=ObjectMoveTable,CN=FileLinks,CN=System," & sDomain ,_                                      vbNullString, vbNullString, _                                      1) ' ADS_SECURE_AUTHENTICATIONcall PurgeContainer( oTarget, "linkTrackOMTEntry" )oTarget = NULL'' Purge the System/FileLinks/VolumeTable'wscript.stdout.writeline "" ' ignored by wscriptwscript.echo "Purging VolumeTable"Set oTarget = oProvider.OpenDSObject("LDAP://" & sServer  & "cn=VolumeTable,CN=FileLinks,CN=System," & sDomain  ,_                                     vbNullString, vbNullString, _                                     1) ' ADS_SECURE_AUTHENTICATIONcall PurgeContainer( oTarget, "linkTrackVolEntry" )oTarget = NULLoProvider = NULL				
< 此处 END 复制 >

警告:本文已自动翻译

属性

文章 ID:315229 - 上次审阅时间:12/03/2007 04:46:54 - 修订版本: 6.4

Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Microsoft Windows 2000 Professional Edition, Microsoft Windows 2000 Datacenter Server, Microsoft Windows Server 2003 Standard Edition, Microsoft Windows Server 2003 Enterprise Edition, Microsoft Windows Server 2003 Datacenter Edition, Microsoft Windows Server 2003, Enterprise x64 Edition, Microsoft Windows Server 2003, 64-Bit Datacenter Edition, Microsoft Windows XP Professional Edition, Microsoft Windows Small Business Server 2003 Premium Edition, Microsoft Windows Small Business Server 2003 Standard Edition

  • kbmt kbenv kbinfo KB315229 KbMtzh
反馈