Skip to content

Commit

Permalink
Merge version 1.2 into main
Browse files Browse the repository at this point in the history
Merge version 1.2 into main
  • Loading branch information
htcfreek authored Apr 4, 2023
2 parents f8f116f + a59c9b2 commit 4af4c9b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<#
Name: ResetLapsPassword
Version: 1.1
Version: 1.2
Developer: htcfreek (Heiko Horwedel)
Created at: 30.03.2023
Created at: 04.04.2023
Github URL: https://github.com/htcfreek/PreOS-ResetLapsPassword
Systems requirements:
Expand All @@ -25,7 +25,7 @@ Package variables:
If set to 1 the password is reset immediately instead of changing the expiration time.
(Enforced automatically in Azure AD environments, because changing the expiration time is not supported in this scenario.)
Exit-Codes:
Exit codes:
0 : Script executed successful.
501 : Package execution has stopped, because it is running in WinPE.
502 : Operating System is not supported.
Expand All @@ -40,11 +40,19 @@ Exit-Codes:
511 : Windows LAPS password reset failed.
512 : Legacy Microsoft LAPS password reset failed.
Log levels:
ERROR : Something that is causing the script to fail.
WARNING : Something that might need some action.
NOTICE : An information that is important.
INFORMATION : Normal execution information. (No prefix in the log text.)
DEBUG : Information needed when analyzing problems. (No prefix in the log text and written to "Host" log only.)
Changes (Date / Version / Author / Change):
2022-11-11 / 0.1 / htcfreek / Initial pre-release version of the package.
2023-01-25 / 0.2 / htcfreek / Complete rewrite of the package with changed variables and behavior.
2023-02-19 / 1.0 / htcfreek / Fix exception for missing LAPS user, comment improvement and first stable release.
2023-03-30 / 1.1 / htcfreek / Fix incorrect detection of missing Windows LAPS on unsupported systems with missing Legacy CSE.; Clean up PXE log in EMC.; Other log improvements (reboot, managed user).
2023-04-04 / 1.2 / htcfreek / Improved reboot behavior on pending Domain join reboot.; Adding a description of the log levels.
#>

Expand Down Expand Up @@ -202,7 +210,11 @@ function Update-ClientMgmtConfiguration([int]$IntuneSyncTimeout)
$regNetlogon = Get-ChildItem -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Name
if (($regNetlogon -contains 'JoinDomain') -or ($regNetlogon -contains 'AvoidSpnSet'))
{
ExitWithCodeMessage -errorCode 504 -errorMessage "IMPORTANT: Pending reboot from an Active Directory domain join detected! - Rebooting client ..." -isAbortReboot
WriteLogInfo "NOTICE: Pending reboot from an Active Directory domain join detected! - Reboot required."

# Setting "on error delay" to 5 seconds and exit with error code other than 0 to reboot immediately and restart the package execution.
Set-EmpirumAgentSetting -Key "Matrix42.Platform.Service.Extension.PeAgent.DelayOnErrorInSeconds" -Value 5
ExitWithCodeMessage -errorCode 504 -errorMessage "NOTICE: Rebooting the client, to continue the package execution afterwards ..." -isAbortReboot
}

# If the device is joined to a local Active Directory, then update the GPOs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PreOS-Package: ResetLapsPassword
Author: Heiko Horwedel (htcfreek)
Version: 1.1
Version: 1.2


PACKAGE INFORMATION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<EmpirumPackage UUID="88a37929-0b7d-4434-9ee7-1d9f551a4c61" Name="ResetLapsPassword 1.1" Type="OSPackage" Version="1.0">
<VersionInformation Version="1.1" Revision="0" />
<EmpirumPackage UUID="82cea1eb-737d-4a00-a5bb-b838468425b5" Name="ResetLapsPassword 1.2" Type="OSPackage" Version="1.0">
<VersionInformation Version="1.2" Revision="0" />
<TargetPath />
<Description>This package triggers the reset of the LAPS password for the client on which it is running.</Description>
<DatabaseSettings></DatabaseSettings>
Expand All @@ -10,8 +10,8 @@
<CatalogueID i:nil="true" />
<GenerallyReleased>0001-01-01T00:00:00</GenerallyReleased>
<Icon i:nil="true" />
<Id>88a37929-0b7d-4434-9ee7-1d9f551a4c61</Id>
<Name>ResetLapsPassword 1.1</Name>
<Id>82cea1eb-737d-4a00-a5bb-b838468425b5</Id>
<Name>ResetLapsPassword 1.2</Name>
<PackageAssignments />
<ProductKey i:nil="true" />
<Revision>0</Revision>
Expand Down Expand Up @@ -111,7 +111,7 @@
</SoftwareVarDefinition>
</SoftwareVarDefinitions>
<Vendor>htcfreek</Vendor>
<Version>1.1</Version>
<Version>1.2</Version>
<VersionFile i:nil="true" />
<AllowUnInstallation>false</AllowUnInstallation>
<Author i:nil="true" />
Expand All @@ -122,7 +122,7 @@
<CheckReg i:nil="true" />
<CreationDate i:nil="true" />
<Description>This package triggers the reset of the LAPS password for the client on which it is running.</Description>
<Directory>%Packages%\htcfreek\OsPackages\ResetLapsPassword\1.1</Directory>
<Directory>%Packages%\htcfreek\OsPackages\ResetLapsPassword\1.2</Directory>
<Discontinue i:nil="true" />
<DiskFreeApplication>0</DiskFreeApplication>
<DiskFreeSystem>0</DiskFreeSystem>
Expand All @@ -141,7 +141,7 @@
<MachineKeyName i:nil="true" />
<Method i:nil="true" />
<MinBandwidth i:nil="true" />
<PackageName>htcfreek\OsPackages\ResetLapsPassword\1.1</PackageName>
<PackageName>htcfreek\OsPackages\ResetLapsPassword\1.2</PackageName>
<ParentID i:nil="true" />
<Path i:nil="true" />
<ProcessorSpeed>0</ProcessorSpeed>
Expand Down

0 comments on commit 4af4c9b

Please sign in to comment.