external help file | Module Name | online version | schema |
---|---|---|---|
DSInternals.PowerShell.dll-Help.xml |
DSInternals |
2.0.0 |
Writes information about the DC to a ntds.dit file, including the highest committed USN and database epoch.
Set-ADDBDomainController [-Force] -DatabasePath <String> [-LogPath <String>] -HighestCommittedUsn <Int64>
[<CommonParameters>]
Set-ADDBDomainController [-Force] -DatabasePath <String> [-LogPath <String>] -Epoch <Int32>
[<CommonParameters>]
Set-ADDBDomainController [-Force] -DatabasePath <String> [-LogPath <String>] -BackupExpiration <DateTime>
[<CommonParameters>]
The Set-ADDBDomainController cmdlet can be used to simulate USN rollbacks, USN depletion, and database file restore operations. This cmdlet should only be used in lab environments.
PS C:\> $currentEpoch = Get-ItemPropertyValue -Path 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NTDS\Parameters' -Name 'DSA Database Epoch'
PS C:\> Set-ADDBDomainController -DatabasePath .\ntds.dit -Epoch $currentEpoch -Force
Copies the database epoch from registry to the ntds.dit file.
PS C:\> Set-ADDBDomainController -DatabasePath .\ntds.dit -HighestCommittedUsn 9223372036854775800 -Force
Modifies the highest committed USN of the AD database. This might be helpful when trying to simulate USN rollbacks and USN depletion.
Specifies the database backup expiration time.
Type: DateTime
Parameter Sets: Expiration
Aliases: Expiration, Expire
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the path to a domain database, for instance, C:\Windows\NTDS\ntds.dit.
Type: String
Parameter Sets: (All)
Aliases: Database, DBPath, DatabaseFilePath, DBFilePath
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the database epoch which must be consistent with the information in the registry.
Type: Int32
Parameter Sets: Epoch
Aliases: DSAEpoch
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Confirms that you understand the implications of using this cmdlet and still want to use it.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the highest committed USN for the database.
Type: Int64
Parameter Sets: USN
Aliases: USN
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the path to a directory where the transaction log files are located. For instance, C:\Windows\NTDS. The default log directory is the one that contains the database file itself.
Type: String
Parameter Sets: (All)
Aliases: Log, TransactionLogPath
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.