nachgefragt
Goto Top

Benutzer über das Ablaufen ihrer Active Directory-Passwörter via E-Mail benachrichtigen

Hallo Administratoren,

obwohl unsere Mitarbeiter per Popup mehrere Tage vorher über den anstehenden Passwortwechel informiert werden, gibt es doch den einen oder anderen Spezialisten, welcher Talent hat es diesen Hinweis immer und immer wieder zu übersehen.

Gibt es dafür ein Bordmittel, wie hier Benutzer über das Ablaufen ihrer Active Directory-Passwörter via E-Mail benachrichtigen vorgeschlagen? Kann man auch ohne Zusatzsoftware den Hinweis auch per E-Mail an den entsprechenden Benutzer verschicken?

Danke für den Input!

Content-Key: 579871

Url: https://administrator.de/contentid/579871

Ausgedruckt am: 28.03.2024 um 16:03 Uhr

Mitglied: 144260
144260 17.06.2020 aktualisiert um 12:50:14 Uhr
Goto Top
EInfach hier mal die Suche benutzen face-wink
AD Password Reminder Mail
E-Mail bei AD-Passwort-Ablauf
Mitglied: ArnoNymous
ArnoNymous 17.06.2020 um 12:53:09 Uhr
Goto Top
Moin,

ich habe hier PassAlert im Einsatz. Das ist einfach, kostenlos und erfüllt seinen Zweck.
Man kann bis zu 3 Benachrichtigungen konfigurieren.

Gruß
Mitglied: nachgefragt
nachgefragt 17.06.2020 um 12:56:02 Uhr
Goto Top
Zitat von @144260:

EInfach hier mal die Suche benutzen face-wink

Erwischt face-wink
Danke.
Mitglied: nachgefragt
nachgefragt 17.06.2020 um 13:05:49 Uhr
Goto Top
Zitat von @ArnoNymous:
ich habe hier PassAlert im Einsatz. Das ist einfach, kostenlos und erfüllt seinen Zweck.
Man kann bis zu 3 Benachrichtigungen konfigurieren.
Danke, ist aber auch kein Bordmittel, oder?
Die Google-Suchergebnisse sind auch schon recht alt.
Mitglied: tech-flare
tech-flare 17.06.2020 um 13:15:24 Uhr
Goto Top
Zitat von @nachgefragt:

Hallo Administratoren,

obwohl unsere Mitarbeiter per Popup mehrere Tage vorher über den anstehenden Passwortwechel informiert werden, gibt es doch den einen oder anderen Spezialisten, welcher Talent hat es diesen Hinweis immer und immer wieder zu übersehen.

Gibt es dafür ein Bordmittel, wie hier Benutzer über das Ablaufen ihrer Active Directory-Passwörter via E-Mail benachrichtigen vorgeschlagen? Kann man auch ohne Zusatzsoftware den Hinweis auch per E-Mail an den entsprechenden Benutzer verschicken?

Danke für den Input!


<#	
	.NOTES
	===========================================================================
	 Created on:   	3/27/2018 7:37 PM
	 Created by:   	Bradley Wyatt
	 Version: 	    1.0.0
	 Notes:
	The variables you should change are the SMTP Host, From Email and Expireindays. I suggest keeping the DirPath
	SMTPHOST: The smtp host it will use to send mail
	FromEmail: Who the script will send the e-mail from
	ExpireInDays: Amount of days before a password is set to expire it will look for, in my example I have 7. Any password that will expire in 7 days or less will start sending an email notification 

	Run the script manually first as it will ask for credentials to send email and then safely store them for future use.
	===========================================================================
	.DESCRIPTION
		This script will send an e-mail notification to users where their password is set to expire soon. It includes step by step directions for them to 
		change it on their own.

		It will look for the users e-mail address in the emailaddress attribute and if it's empty it will use the proxyaddress attribute as a fail back.   

		The script will log each run at $DirPath\log.txt
#>

#VARs

#SMTP Host
$SMTPHost = "smtp.office365.com"  
#Who is the e-mail from
$FromEmail = "automation@thelazyadministrator.com"  
#Password expiry days
$expireindays = 7

#Program File Path
$DirPath = "C:\Automation\PasswordExpiry"  

$Date = Get-Date
#Check if program dir is present
$DirPathCheck = Test-Path -Path $DirPath
If (!($DirPathCheck))
{
	Try
	{
		#If not present then create the dir
		New-Item -ItemType Directory $DirPath -Force
	}
	Catch
	{
		$_ | Out-File ($DirPath + "\" + "Log.txt") -Append  
	}
}
#CredObj path
$CredObj = ($DirPath + "\" + "EmailExpiry.cred")  
#Check if CredObj is present
$CredObjCheck = Test-Path -Path $CredObj
If (!($CredObjCheck))
{
	"$Date - INFO: creating cred object" | Out-File ($DirPath + "\" + "Log.txt") -Append  
	#If not present get office 365 cred to save and store
	$Credential = Get-Credential -Message "Please enter your Office 365 credential that you will use to send e-mail from $FromEmail. If you are not using the account $FromEmail make sure this account has 'Send As' rights on $FromEmail."  
	#Export cred obj
	$Credential | Export-CliXml -Path $CredObj
}

Write-Host "Importing Cred object..." -ForegroundColor Yellow  
$Cred = (Import-CliXml -Path $CredObj)


# Get Users From AD who are Enabled, Passwords Expire and are Not Currently Expired
"$Date - INFO: Importing AD Module" | Out-File ($DirPath + "\" + "Log.txt") -Append  
Import-Module ActiveDirectory
"$Date - INFO: Getting users" | Out-File ($DirPath + "\" + "Log.txt") -Append  
$users = Get-Aduser -properties Name, PasswordNeverExpires, PasswordExpired, PasswordLastSet, EmailAddress -filter { (Enabled -eq 'True') -and (PasswordNeverExpires -eq 'False') } | Where-Object { $_.PasswordExpired -eq $False }  

$maxPasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge

# Process Each User for Password Expiry
foreach ($user in $users)
{
	$Name = (Get-ADUser $user | ForEach-Object { $_.Name })
	Write-Host "Working on $Name..." -ForegroundColor White  
	Write-Host "Getting e-mail address for $Name..." -ForegroundColor Yellow  
	$emailaddress = $user.emailaddress
	If (!($emailaddress))
	{
		Write-Host "$Name has no E-Mail address listed, looking at their proxyaddresses attribute..." -ForegroundColor Red  
		Try
		{
			$emailaddress = (Get-ADUser $user -Properties proxyaddresses | Select-Object -ExpandProperty proxyaddresses | Where-Object { $_ -cmatch '^SMTP' }).Trim("SMTP:")  
		}
		Catch
		{
			$_ | Out-File ($DirPath + "\" + "Log.txt") -Append  
		}
		If (!($emailaddress))
		{
			Write-Host "$Name has no email addresses to send an e-mail to!" -ForegroundColor Red  
			#Don't continue on as we can't email $Null, but if there is an e-mail found it will email that address  
			"$Date - WARNING: No email found for $Name" | Out-File ($DirPath + "\" + "Log.txt") -Append  
		}
		
	}
	#Get Password last set date
	$passwordSetDate = (Get-ADUser $user -properties * | ForEach-Object { $_.PasswordLastSet })
	#Check for Fine Grained Passwords
	$PasswordPol = (Get-ADUserResultantPasswordPolicy $user)
	if (($PasswordPol) -ne $null)
	{
		$maxPasswordAge = ($PasswordPol).MaxPasswordAge
	}
	
	$expireson = $passwordsetdate + $maxPasswordAge
	$today = (get-date)
	#Gets the count on how many days until the password expires and stores it in the $daystoexpire var
	$daystoexpire = (New-TimeSpan -Start $today -End $Expireson).Days
	
	If (($daystoexpire -ge "0") -and ($daystoexpire -lt $expireindays))  
	{
		"$Date - INFO: Sending expiry notice email to $Name" | Out-File ($DirPath + "\" + "Log.txt") -Append  
		Write-Host "Sending Password expiry email to $name" -ForegroundColor Yellow  
		
		$SmtpClient = new-object system.net.mail.smtpClient
		$MailMessage = New-Object system.net.mail.mailmessage
		
		#Who is the e-mail sent from
		$mailmessage.From = $FromEmail
		#SMTP server to send email
		$SmtpClient.Host = $SMTPHost
		#SMTP SSL
		$SMTPClient.EnableSsl = $true
		#SMTP credentials
		$SMTPClient.Credentials = $cred
		#Send e-mail to the users email
		$mailmessage.To.add("$emailaddress")  
		#Email subject
		$mailmessage.Subject = "Your password will expire $daystoexpire days"  
		#Notification email on delivery / failure
		$MailMessage.DeliveryNotificationOptions = ("onSuccess", "onFailure")  
		#Send e-mail with high priority
		$MailMessage.Priority = "High"  
		$mailmessage.Body =
		"Dear $Name,  
Your Domain password will expire in $daystoexpire days. Please change it as soon as possible.

To change your password, follow the method below:

1. On your Windows computer
	a.	If you are not in the office, logon and connect to VPN. 
	b.	Log onto your computer as usual and make sure you are connected to the internet.
	c.	Press Ctrl-Alt-Del and click on ""Change Password"".  
	d.	Fill in your old password and set a new password.  See the password requirements below.
	e.	Press OK to return to your desktop. 

The new password must meet the minimum requirements set forth in our corporate policies including:
	1.	It must be at least 8 characters long.
	2.	It must contain at least one character from 3 of the 4 following groups of characters:
		a.  Uppercase letters (A-Z)
		b.  Lowercase letters (a-z)
		c.  Numbers (0-9)
		d.  Symbols (!@#$%^&*...)
	3.	It cannot match any of your past 24 passwords.
	4.	It cannot contain characters which match 3 or more consecutive characters of your username.
	5.	You cannot change your password more often than once in a 24 hour period.

If you have any questions please contact our Support team at support@thelazyadministrator.com or call us at 555.555.5555

Thanks,
The Lazy Administrator
support@thelazyadministrator.com
555.555.5555"  
		Write-Host "Sending E-mail to $emailaddress..." -ForegroundColor Green  
		Try
		{
			$smtpclient.Send($mailmessage)
		}
		Catch
		{
			$_ | Out-File ($DirPath + "\" + "Log.txt") -Append  
		}
	}
	Else
	{
		"$Date - INFO: Password for $Name not expiring for $daystoexpire days" | Out-File ($DirPath + "\" + "Log.txt") -Append  
		Write-Host "Password for $Name does not expire for $daystoexpire days" -ForegroundColor White  
	}
}

Gefunden auf

https://www.thelazyadministrator.com/2018/03/28/email-users-when-their-a ...
Mitglied: sofifreak
Lösung sofifreak 18.06.2020 um 08:13:18 Uhr
Goto Top
Hallo,

wir lösen das über ein Script, das einmal die Woche eine Email an die Nutzer und den Admin versendet. Ab Kennwort Gültigkeit unter 28 Tage.

Meine persönliche Meinung und Erfahrung. Es bringt nichts! Gar nichts. Email wird ignoriert und hundert Ausreden erfunden. Der Aufwand mit abgelaufenen Kennwörtern reduziert sich nicht.

Schöne Restwoche noch

So long
Gruß

Daniel
Mitglied: nachgefragt
nachgefragt 18.06.2020 um 09:36:30 Uhr
Goto Top
Zitat von @sofifreak:
Meine persönliche Meinung und Erfahrung. Es bringt nichts! Gar nichts. Email wird ignoriert und hundert Ausreden erfunden. Der Aufwand mit abgelaufenen Kennwörtern reduziert sich nicht.
damit nimmst du mir den Wind aus den Segeln, ich kann es aber gut nachvollziehen.
Mitglied: 144260
144260 18.06.2020 aktualisiert um 10:00:24 Uhr
Goto Top
Regelmäßige Änderungen der Passwörter haben wir schon lange abgeschafft, bringt i. d. Regel keinen Sicherheitsgewinn und meist nur Probleme, im Gegenteil, die PW geraten dann aus Faulheit zu simpel oder die Leute kleben sich die irgendwo auf die Möbel. Wir setzen überall nun 2 Faktor-Auth mit Tokens und PIN/Pass ein, da entfällt das unsinnige regelmäßige Tauschen der Passwörter.
Mitglied: nachgefragt
nachgefragt 18.06.2020 um 10:22:16 Uhr
Goto Top
Zitat von @144260:
keinen Sicherheitsgewinn und meist nur Probleme, im Gegenteil, die PW geraten dann aus Faulheit zu simpel oder die Leute kleben sich die irgendwo auf die Möbel
Der Komplexitätsgrad des Kennworts kann durch die AD Vorgabe nicht umgangen werden.

Ich kenne auch Kollegen welche sich gern Codes unter die Tastatur klemmen.

Hier müssen Führungskräte und Geschäftsleitung zusammenarbeiten. Wenn bei einem Vorstoß mit Konsequenzen gehandelt wird, verbreitet sich dies wie ein Lauffeuer im Unternehmen. Aber auch, "wenn ja ey nix passiert" ist das eine Signalwirkung der Führungskräte und Geschäftsleitung, dass diesen diese Richtlinien ziemlich egal sind.

Wir, die IT, können in dem Fall technische Maßnahmen treffen, bei organisatorischen kann man den Aufgabenumfang und Verantwortung nicht auf uns allein abwälzen.
Mitglied: 144260
144260 18.06.2020 aktualisiert um 10:32:53 Uhr
Goto Top
Zitat von @nachgefragt:
Der Komplexitätsgrad des Kennworts kann durch die AD Vorgabe nicht umgangen werden.
Sicher, nur entsteht in der Regel dann meist auch nur Bullshit, was ich bisher so gesehen habe.
Naja, wie sagt man so schön, jedem sein Pläsierchen...
Mitglied: nachgefragt
nachgefragt 18.06.2020 um 10:37:20 Uhr
Goto Top
Zitat von @144260:
Naja, wie sagt man so schön, jedem sein Pläsierchen...
...jedem Tierchen sein Pläsierchen...
...leben und leben lassen...
Mitglied: ArnoNymous
ArnoNymous 18.06.2020 um 15:57:19 Uhr
Goto Top
Zitat von @nachgefragt:

Zitat von @ArnoNymous:
ich habe hier PassAlert im Einsatz. Das ist einfach, kostenlos und erfüllt seinen Zweck.
Man kann bis zu 3 Benachrichtigungen konfigurieren.
Danke, ist aber auch kein Bordmittel, oder?
Die Google-Suchergebnisse sind auch schon recht alt.


Das ist halt ne GUI die dann ein Skript im Hintergrund ausführt. Ist schon alt, aber funktioniert mzumindest mit WinSvr2016 noch tadellos. Und im Gegensatz zu dem Kollegen konnte ich hier doch eine wesentliche Verbesserung des userverhaltens feststellen.