diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index 7a53777a..18c29946 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [4.16] - 2025-01-05 + +### Added + +- The `DomainController` class exposes more DC properties, including `ServerObjectDN`, `NTDSSettingsObjectDN`, and `ForestRootNamingContext`. + +### Fixed + +- The [New-ADDBRestoreFromMediaScript](PowerShell/New-ADDBRestoreFromMediaScript.md#new-addbrestorefrommediascript) cmdlet now properly sets the `Configuration NC`, `Root Domain`, and `Machine DN Name` registry values under the `HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters` key. + ## [4.15.1] - 2025-01-02 This is a PowerShell-only bugfix release. @@ -541,6 +551,7 @@ This is a [Chocolatey](https://chocolatey.org/packages/dsinternals-psmodule)-onl Initial release! [Unreleased]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.15.1...HEAD +[4.15.1]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.15.1...v4.16 [4.15.1]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.15...v4.15.1 [4.15]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.14...v4.15 [4.14]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.13...v4.14 diff --git a/Src/DSInternals.DataStore/DSInternals.DataStore.nuspec b/Src/DSInternals.DataStore/DSInternals.DataStore.nuspec index a9d2de39..52c313f5 100644 --- a/Src/DSInternals.DataStore/DSInternals.DataStore.nuspec +++ b/Src/DSInternals.DataStore/DSInternals.DataStore.nuspec @@ -14,7 +14,7 @@ DSInternals DataStore is an advanced framework for offline ntds.dit file manipulation. It can be used to extract password hashes from Active Directory backups or to modify the sIDHistory and primaryGroupId attributes. DSInternals DataStore is an advanced framework for offline ntds.dit file manipulation. -- Minor credential roaming parser improvement. +- The `DomainController` class exposes more DC properties, including `ServerObjectDN`, `NTDSSettingsObjectDN`, and `ForestRootNamingContext`. Copyright (c) 2015-2025 Michael Grafnetter. All rights reserved. ActiveDirectory Security NTDS AD Identity Active Directory diff --git a/Src/DSInternals.DataStore/DomainController.cs b/Src/DSInternals.DataStore/DomainController.cs index 4f6993b4..01e63281 100644 --- a/Src/DSInternals.DataStore/DomainController.cs +++ b/Src/DSInternals.DataStore/DomainController.cs @@ -12,6 +12,7 @@ /// public class DomainController : IDisposable, IDomainController { + // TODO: Refactor properties and add more of them to the IDomainController interface. public const long UsnMinValue = 1; public const long UsnMaxValue = long.MaxValue; public const long EpochMinValue = 1; @@ -101,7 +102,7 @@ public DomainController(DirectoryContext context) this.ConfigurationNamingContext = context.DistinguishedNameResolver.Resolve(this.ConfigurationNamingContextDNT); // Forest Root Domain NC should be the parent of the Configuration NC - this.ForestRootNamingContext = this.ConfigurationNamingContext.Parent + this.ForestRootNamingContext = this.ConfigurationNamingContext.Parent; // Retrieve Schema Naming Context this.SchemaNamingContextDNT = dataTableCursor.RetrieveColumnAsDNTag(schema.FindColumnId(CommonDirectoryAttributes.SchemaLocation)).Value; diff --git a/Src/DSInternals.DataStore/Properties/AssemblyInfo.cs b/Src/DSInternals.DataStore/Properties/AssemblyInfo.cs index 1b72f6e8..62434ba6 100644 --- a/Src/DSInternals.DataStore/Properties/AssemblyInfo.cs +++ b/Src/DSInternals.DataStore/Properties/AssemblyInfo.cs @@ -5,8 +5,8 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DSInternals DataStore Library")] -[assembly: AssemblyVersion("4.14")] -[assembly: AssemblyFileVersion("4.14")] +[assembly: AssemblyVersion("4.16")] +[assembly: AssemblyFileVersion("4.16")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] diff --git a/Src/DSInternals.PowerShell/Chocolatey/dsinternals-psmodule.nuspec b/Src/DSInternals.PowerShell/Chocolatey/dsinternals-psmodule.nuspec index 84f1f6c5..f0d9655b 100644 --- a/Src/DSInternals.PowerShell/Chocolatey/dsinternals-psmodule.nuspec +++ b/Src/DSInternals.PowerShell/Chocolatey/dsinternals-psmodule.nuspec @@ -3,7 +3,7 @@ DSInternals-PSModule - 4.15.1 + 4.16 https://github.com/MichaelGrafnetter/DSInternals/tree/master/Src/DSInternals.PowerShell/Chocolatey MichaelGrafnetter DSInternals PowerShell Module @@ -37,7 +37,7 @@ The DSInternals PowerShell Module has these main features: ## Disclaimer Features exposed through these tools are not supported by Microsoft. Improper use might cause irreversible damage to domain controllers or negatively impact domain security. -* The Test-PasswordQuality cmdlet should no longer return the AmbiguousParameterSet error. +* The `New-ADDBRestoreFromMediaScript` cmdlet now properly sets the `Configuration NC`, `Root Domain`, and `Machine DN Name` registry values under the `HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters` key. diff --git a/Src/DSInternals.PowerShell/Commands/Datastore/NewADDBRestoreFromMediaScriptCommand.cs b/Src/DSInternals.PowerShell/Commands/Datastore/NewADDBRestoreFromMediaScriptCommand.cs index 80545f39..89b8367c 100644 --- a/Src/DSInternals.PowerShell/Commands/Datastore/NewADDBRestoreFromMediaScriptCommand.cs +++ b/Src/DSInternals.PowerShell/Commands/Datastore/NewADDBRestoreFromMediaScriptCommand.cs @@ -73,7 +73,7 @@ protected override void ProcessRecord() } } - var dc = this.DirectoryContext.DomainController; + DomainController dc = this.DirectoryContext.DomainController; if (this.SysvolPath == null) { // Presume that the database is part of an IFM backup: @@ -86,13 +86,13 @@ protected override void ProcessRecord() // TODO: Check backup expiration time string winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows); - string targetDatabaseDirectory = Path.Combine(windir, "NTDS"); + string targetDatabaseDirectory = Path.Combine(winDir, "NTDS"); string targetDatabasePath = Path.Combine(targetDatabaseDirectory, "ntds.dit"); - string targetSysvolPath = Path.Combine(windir, "SYSVOL"); + string targetSysvolPath = Path.Combine(winDir, "SYSVOL"); // Load the RFM script template and replace placeholders with values from the DB: string template = LoadScriptTemplate(); - var script = new StringBuilder(template). + StringBuilder script = new StringBuilder(template). Replace("{DCName}", dc.Name). Replace("{DCHostName}", dc.HostName). Replace("{DCGuid}", dc.Guid.ToString()). diff --git a/Src/DSInternals.PowerShell/DSInternals.psd1 b/Src/DSInternals.PowerShell/DSInternals.psd1 index e0bf9aa7..7399476a 100644 --- a/Src/DSInternals.PowerShell/DSInternals.psd1 +++ b/Src/DSInternals.PowerShell/DSInternals.psd1 @@ -8,7 +8,7 @@ RootModule = 'DSInternals.Bootstrap.psm1' # Version number of this module. -ModuleVersion = '4.15.1' +ModuleVersion = '4.16' # Supported PSEditions # CompatiblePSEditions = 'Desktop' @@ -143,7 +143,7 @@ PrivateData = @{ # ReleaseNotes of this module ReleaseNotes = @" -- The Test-PasswordQuality cmdlet should no longer return the AmbiguousParameterSet error. +- The New-ADDBRestoreFromMediaScript cmdlet now properly sets the "Configuration NC", "Root Domain", and "Machine DN Name" registry values under the "HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" key. "@ } # End of PSData hashtable diff --git a/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs b/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs index fd3c6011..12496f80 100644 --- a/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs +++ b/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs @@ -5,8 +5,8 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DSInternals PowerShell Commands")] -[assembly: AssemblyVersion("4.15.1")] -[assembly: AssemblyFileVersion("4.15.1")] +[assembly: AssemblyVersion("4.16")] +[assembly: AssemblyFileVersion("4.16")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")]