This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################################# | |
# | |
# Password-Expiration-Notifications v20220823 | |
# Highly Modified fork. https://gist.github.com/meoso/3488ef8e9c77d2beccfd921f991faa64 | |
# | |
# Originally from v1.4 @ https://gallery.technet.microsoft.com/Password-Expiry-Email-177c3e27 | |
# https://windowspoweressentials.com/2017/02/21/powershell-password-reminder-script-updated/ | |
# https://github.com/titlerequired/public | |
# Robert Pearman (WSSMB MVP) | |
# TitleRequired.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all logs | |
TRUNCATE ps_log; | |
# Delete old connection data (only used for stats) | |
# change 2016-02-01 00:00:00 according to you needs | |
DELETE c, cs | |
FROM ps_connections c | |
LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections) | |
WHERE c.date_add < '2016-02-01 00:00:00'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Add-EnvPath { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] $Path, | |
[ValidateSet('Machine', 'User', 'Session')] | |
[string] $Container = 'Session' | |
) | |
if ($Container -ne 'Session') { |