Skip to content

Commit dba91c8

Browse files
Prepare for release 5.2
1 parent 021ac9a commit dba91c8

File tree

21 files changed

+131
-38
lines changed

21 files changed

+131
-38
lines changed

Documentation/CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ All notable changes to this project will be documented in this file. The format
77

88
## [Unreleased]
99

10+
## [5.2] - 2025-04-09
11+
12+
### Added
13+
14+
- Added the [Set-ADDBAccountControl](PowerShell/Set-ADDBAccountControl.md#set-addbaccountcontrol) cmdlet for offline modification of the `userAccountControl` attribute flags.
15+
- Added a new parameter called `-PostInstallScriptPath` to the [New-ADDBRestoreFromMediaScript](PowerShell/New-ADDBRestoreFromMediaScript.md#new-addbrestorefrommediascript) cmdlet.
16+
17+
### Fixed
18+
19+
- Resolved issue #193: Call to `GetAccounts()` returns `NotImplementedException`.
20+
1021
## [5.1] - 2025-03-22
1122

1223
### Added
@@ -570,7 +581,8 @@ This is a [Chocolatey](https://chocolatey.org/packages/dsinternals-psmodule)-onl
570581
## 1.0 - 2015-01-20
571582
Initial release!
572583

573-
[Unreleased]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.1...HEAD
584+
[Unreleased]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.2...HEAD
585+
[5.2]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.1...v5.2
574586
[5.1]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.0...v5.1
575587
[5.0]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.16...v5.0
576588
[4.16]: https://github.com/MichaelGrafnetter/DSInternals/compare/v4.15.1...v4.16

Documentation/PowerShell/New-ADDBRestoreFromMediaScript.Sample.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The DSInternals PowerShell module must be installed for all users on the target
2525
It is recommended to change the DSRM password after DC promotion.
2626
2727
Author: Michael Grafnetter
28-
Version: 2.3
28+
Version: 2.4
2929
3030
#>
3131

@@ -42,7 +42,6 @@ Import-Module -Name DSInternals -ErrorAction Stop
4242

4343
function Main {
4444
[string] $script:LogFile = "$env:windir\Logs\DSInternals-RestoreFromMedia.txt"
45-
[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8
4645
$PSDefaultParameterValues = @{ 'Out-File:Encoding' = 'utf8' }
4746
Write-Log -Message "Starting script execution in phase $Phase..."
4847

@@ -303,6 +302,20 @@ function Main {
303302
# Update FRS subscription if present in AD.
304303
Update-FrsSubscription -DomainControllerDN 'CN=LON-DC1,OU=Domain Controllers,DC=Adatum,DC=com' `
305304
-SysvolPath 'C:\Windows\SYSVOL'
305+
306+
# Continue to the next phase.
307+
Register-ScheduledScript -ExecutePhase 8
308+
}
309+
8 {
310+
# Execute an optional post-installation script.
311+
[string] $postInstallScriptPath = 'C:\PostInstall.ps1'
312+
if(-not [string]::IsNullOrEmpty($postInstallScriptPath)) {
313+
Write-Log -Message 'Executing the post-installation script...'
314+
& $postInstallScriptPath *>> $script:LogFile
315+
} else {
316+
Write-Log -Message 'No post-installation script is configured. Skipping execution.'
317+
}
318+
306319
}
307320
}
308321

Documentation/PowerShell/New-ADDBRestoreFromMediaScript.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Generates a PowerShell script that can be used to restore a domain controller fr
1414

1515
```
1616
New-ADDBRestoreFromMediaScript [-BootKey <Byte[]>] [-SysvolPath <String>]
17-
-SafeModeAdministratorPassword <SecureString> [-SkipDNSServer] -DatabasePath <String> [-LogPath <String>]
18-
[<CommonParameters>]
17+
-SafeModeAdministratorPassword <SecureString> [-SkipDNSServer] [-PostInstallScriptPath <String>]
18+
-DatabasePath <String> [-LogPath <String>] [<CommonParameters>]
1919
```
2020

2121
## DESCRIPTION
@@ -128,6 +128,21 @@ Accept pipeline input: False
128128
Accept wildcard characters: False
129129
```
130130
131+
### -PostInstallScriptPath
132+
Specifies the path to an optional post-installation script that will be executed after the restore process is complete.
133+
134+
```yaml
135+
Type: String
136+
Parameter Sets: (All)
137+
Aliases:
138+
139+
Required: False
140+
Position: Named
141+
Default value: None
142+
Accept pipeline input: False
143+
Accept wildcard characters: False
144+
```
145+
131146
### -SafeModeAdministratorPassword
132147
Supplies the password for the administrator account when the computer is started in Safe Mode or a variant of Safe Mode, such as Directory Services Restore Mode. If no value is specified for this parameter, the cmdlet prompts you to enter and confirm a masked password. If specified with a value, the value must be a secure string.
133148

Documentation/PowerShell/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Disables an Active Directory account in an offline ntds.dit file.
4040
Unlocks an Active Directory account in an offline ntds.dit file.
4141

4242
### [Set-ADDBAccountControl](Set-ADDBAccountControl.md#set-addbaccountcontrol)
43-
Modifies user account control (UAC) values for an Active Directory account in an offline ntds.dit file.
43+
Modifies user account control values for an Active Directory account in an offline ntds.dit file.
4444

4545
### [Add-ADDBSidHistory](Add-ADDBSidHistory.md#add-addbsidhistory)
4646
Adds one or more values to the sIDHistory attribute of an object in a ntds.dit file.

Documentation/PowerShell/Set-ADDBAccountControl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Set-ADDBAccountControl
99

1010
## SYNOPSIS
11-
Modifies user account control (UAC) values for an Active Directory account in an offline ntds.dit file.
11+
Modifies user account control values for an Active Directory account in an offline ntds.dit file.
1212

1313
## SYNTAX
1414

Src/DSInternals.Common/DSInternals.Common.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<description>This package is shared between all other DSInternals packages. Its main features are Azure AD Graph API and ADSI clients for for retrieval of cryptographic material. It contains implementations of common hash functions used by Windows, including NT hash, LM hash and OrgId hash. It also contains methods for SysKey/BootKey retrieval.</description>
1515
<summary>This package is shared between all other DSInternals packages.</summary>
1616
<releaseNotes>
17-
- Added support for retrieval of BitLocker recovery keys, LAPS passwords, DNS resource records, and contact information from Active Directory.
17+
- Added the UserAccountControlExtensions class.
1818
</releaseNotes>
1919
<copyright>Copyright (c) 2015-2025 Michael Grafnetter. All rights reserved.</copyright>
2020
<tags>ActiveDirectory Security AD AAD Identity Active Directory</tags>

Src/DSInternals.Common/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// set of attributes. Change these attribute values to modify the information
66
// associated with an assembly.
77
[assembly: AssemblyTitle("DSInternals Common Library")]
8-
[assembly: AssemblyVersion("5.0")]
9-
[assembly: AssemblyFileVersion("5.0")]
8+
[assembly: AssemblyVersion("5.2")]
9+
[assembly: AssemblyFileVersion("5.2")]
1010
[assembly: AssemblyDescription("")]
1111
[assembly: AssemblyConfiguration("")]
1212
[assembly: AssemblyCompany("")]

Src/DSInternals.DataStore/DSInternals.DataStore.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<description>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.</description>
1515
<summary>DSInternals DataStore is an advanced framework for offline ntds.dit file manipulation.</summary>
1616
<releaseNotes>
17-
- Added support for listing AD-integrated DNS zones.
17+
- Added support for modifying more ucerAccountControl flags.
1818
</releaseNotes>
1919
<copyright>Copyright (c) 2015-2025 Michael Grafnetter. All rights reserved.</copyright>
2020
<tags>ActiveDirectory Security NTDS AD Identity Active Directory</tags>

Src/DSInternals.DataStore/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// set of attributes. Change these attribute values to modify the information
66
// associated with an assembly.
77
[assembly: AssemblyTitle("DSInternals DataStore Library")]
8-
[assembly: AssemblyVersion("5.1")]
9-
[assembly: AssemblyFileVersion("5.1")]
8+
[assembly: AssemblyVersion("5.2")]
9+
[assembly: AssemblyFileVersion("5.2")]
1010
[assembly: AssemblyDescription("")]
1111
[assembly: AssemblyConfiguration("")]
1212
[assembly: AssemblyCompany("")]

Src/DSInternals.PowerShell/ADDBRestoreFromMediaScriptTemplate.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This script performs a multi-phase domain controller restore from an IFM backup:
1313
- Phase 5: Restore the AD database, re-encrypt it, and reconfigure LSA policies.
1414
- Phase 6: Replace the SYSVOL directory, restore ACLs if available, and reboot the server.
1515
- Phase 7: Reconfigure the SYSVOL replication subscription.
16+
- Phase 8: Run an optional post-installation script.
1617
1718
Script exection logs can be found in the C:\Windows\Logs\DSInternals-RestoreFromMedia.txt file.
1819
@@ -25,15 +26,15 @@ The DSInternals PowerShell module must be installed for all users on the target
2526
It is recommended to change the DSRM password after DC promotion.
2627
2728
Author: Michael Grafnetter
28-
Version: 2.3
29+
Version: 2.4
2930
3031
#>
3132

3233
#Requires -Version 3 -Modules DSInternals -RunAsAdministrator
3334

3435
param(
3536
[Parameter(Mandatory = $false)]
36-
[ValidateRange(0, 7)]
37+
[ValidateRange(0, 8)]
3738
[int] $Phase = 0
3839
)
3940

@@ -42,7 +43,6 @@ Import-Module -Name DSInternals -ErrorAction Stop
4243

4344
function Main {
4445
[string] $script:LogFile = "$env:windir\Logs\DSInternals-RestoreFromMedia.txt"
45-
[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8
4646
$PSDefaultParameterValues = @{ 'Out-File:Encoding' = 'utf8' }
4747
Write-Log -Message "Starting script execution in phase $Phase..."
4848

@@ -303,6 +303,19 @@ function Main {
303303
# Update FRS subscription if present in AD.
304304
Update-FrsSubscription -DomainControllerDN '{DCDistinguishedName}' `
305305
-SysvolPath '{TargetSysvolPath}'
306+
307+
# Continue to the next phase.
308+
Register-ScheduledScript -ExecutePhase 8
309+
}
310+
8 {
311+
# Execute an optional post-installation script.
312+
[string] $postInstallScriptPath = '{PostInstallScriptPath}'
313+
if(-not [string]::IsNullOrEmpty($postInstallScriptPath)) {
314+
Write-Log -Message 'Executing the post-installation script...'
315+
& $postInstallScriptPath *>> $script:LogFile
316+
} else {
317+
Write-Log -Message 'No post-installation script is configured. Skipping execution.'
318+
}
306319
}
307320
}
308321

0 commit comments

Comments
 (0)