Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Powershell to email manager of employee's expiring password

$
0
0

Hi, I am a powershell beginner here looking for some guidance.

I have the following script that pulls users that have accounts expiring in the next 14 days and exports them to excel with the manager property, this works great, but what I need to do now is email the managers of each user to inform them they have an employee account expiring, anyone got an idea how to accomplish this task? Thanks!

Search-ADAccount -AccountExpiring -TimeSpan 14.00:00:00 |Get-ADUser -Properties manager,mail,physicalDeliveryOfficeName |Select-Object name,manager,mail,physicalDeliveryOfficeName |Export-Csv -path c:\temp\test.csv -NoTypeInformation


Viewing all articles
Browse latest Browse all 6937

Trending Articles