From 67fa4fa6015b94935f1a3505763d9c3242c390d0 Mon Sep 17 00:00:00 2001 From: Michael Grafnetter Date: Sun, 5 Jan 2025 12:52:21 +0100 Subject: [PATCH] Version 4.16 --- Documentation/CHANGELOG.md | 11 +++++++++++ .../DSInternals.DataStore.nuspec | 2 +- Src/DSInternals.DataStore/DomainController.cs | 3 ++- Src/DSInternals.DataStore/Properties/AssemblyInfo.cs | 4 ++-- .../Chocolatey/dsinternals-psmodule.nuspec | 4 ++-- .../Datastore/NewADDBRestoreFromMediaScriptCommand.cs | 8 ++++---- Src/DSInternals.PowerShell/DSInternals.psd1 | 4 ++-- Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs | 4 ++-- 8 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index 7a53777..18c2994 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 a9d2de3..52c313f 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 4f6993b..01e6328 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 1b72f6e..62434ba 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 84f1f6c..f0d9655 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 80545f3..89b8367 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 e0bf9aa..7399476 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 fd3c601..12496f8 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("")]