I am trying to figure out how to script something that will search AD and set the expiration date of the users based on their creation date, example user created 01/01/2018 they will expire 01/01/2019.
Get-ADUser -Filter * -SearchBase $OuDomain | Set-ADAccountExpiration -DateTime # this is the part where I cannot figure out the select-object Created + 365
Update- I achieved this by exporting users by their username and created date to csv, then manipulated that with cel+365 to create a time stamp of 1 year. Imported that csv via PS then applied the below script to apply the expiration date to the users listed.
foreach ($Users in $Users) {Set-ADUser $Users.Username -AccountExpirationDate $Users.Expires}