Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

AD Id Expiry date output

$
0
0

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


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>