Avatar of Michael Leonard
Michael Leonard
Flag for United States of America asked on

need a powershell or quest AD cmdlets script to send out an HTML attachment

can someone provide a powershell or AD Cmdlets script that we can use to check Active Directory daily to find out what passwords will expire in the next 14 days, and send out an email notice using an html file with variables in it?

many thanks

S.
PowershellPerlScripting Languages

Avatar of undefined
Last Comment
Michael Leonard

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
SubSun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Michael Leonard

ASKER
thank you Subsun and Qlemo. both solutions will work fine for us.

S.
SubSun

Qlemo,  let's agree to disagree!!.. :) .. I didn't post just a link to discussion thread from any other forum.. Moreover I don’t think it’s too cumbersome for an AD administrator to understand what is written in the article as it is very direct an instructive..

The thread which you are referring to have only few comments which referring to the specific code which is used to send HTML email for the users who’s password is going to expire. I agree that posting links is not a good thing to do but, I just didn't want to copy paste the code from the article. If OP have further questions then I would have happy assisted him to update the code..

BTB, Get-QADuser won’t work to find the password expiry date in all scenarios, for instance if you have a windows 2008 R2 or later domain and you have some  fine-grained password policies then you need to use the function Get-XADUserPasswordExpirationDate to find the exact password expiry date of the user.

@siber1, If you have used Qlemo's solution to achieve your goal, then you may request to reopen he question so that the points can be awarded to correct solution, I am ok with it..
SubSun

Got it.. will keep it in mind..
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Michael Leonard

ASKER
Qlemo,
I'm not going to get caught up in the politics of this, but I will say that you are extremely fortunate to have someone the caliber of Subsun posting answers to our questions. He is extremely knowledgeable and his advise and postings are the main reason I subscribe to your service.

Michael aka @siber