Hello All,
In our organisation, we have temp employee for whom we create a AD Id and set the user account expiry date of 45 days after creation of AD Id.
We have been asked to generate the list of temp employee on weekly basis whose AD Id is going to expiry in current week and need to send email notification, informing their AD id is going to expiry after "x" no.of days.
I was able to create a powershell to find, Can you please confirm if is it correct
Search-ADAccount -AccountExpiring |
Get-ADUser -Properties givenName,sn,userprincipalname,accountExpirationdate.
Thanks HA