Skip to content

Instantly share code, notes, and snippets.

@lancehilliard
lancehilliard / ExampleEntities.cs
Created October 20, 2018 01:50
Basic SaveChanges() override for setting existing CreatedBy/CreatedUtc/LastModifiedBy/LastModifiedUtc columns on EF tables.
public partial class ExampleEntities {
private delegate void ColumnValueSetter(DbPropertyEntry entry, DateTimeOffset now);
private static readonly Dictionary<string, ColumnValueSetter> ControlledColumns = new Dictionary<string, ColumnValueSetter> {
{"CreatedBy", ColumnValueSetters.CreatedBy}
, {"CreatedUtc", ColumnValueSetters.CreatedUtc}
, {"LastModifiedBy", ColumnValueSetters.LastModifiedBy}
, {"LastModifiedUtc", ColumnValueSetters.LastModifiedUtc}
};
@lancehilliard
lancehilliard / Windows10ResetLocalAccountPasswordUsingInstallDisk.md
Last active November 17, 2022 15:32
Windows 10: Reset Local Account Password using Install Disk

Windows 10: Reset Local Account Password using Install Disk

Windows 10's install disk is itself bootable and can help us reset the password on a Local Account (not a Microsoft account) of the existing Windows 10 install.

This document doesn't exhaustively detail how to perform every step. It also doesn't discuss consequences of changing a Windows 10 account password, especially when encrypted filesystems are in use. Its intended audience is the user who has researched both (see Credit below as a starting point).

This document also assumes that the existing Windows 10 install is healthy.

This process exploits the fact that our existing Windows 10 install allows us to execute Windows\system32\Utilman.exe before/without logging in, by clicking on the login screen's icon for Ease of Access (formerly Utility Manager). By renaming cmd.exe to Utilman.exe before booting our existing Windows 10 install, we can later get a Command Prompt in the existing Windows 10 install before/without lo