Hello,
I'm very new at scripting but I have the following script
Import-Module ActiveDirectoryimport-csv C:\Users\jpratt\Desktop\book1.csv |
ForEach{
#set expiration date
$expire = read-host -prompt "Should this account expire y/n"
if ($expire -eq "y") {
$expirationdate = read-host -prompt "enter expiration date mm/dd/yy"
$time = [datetime]"$expirationdate" - (Get-Date)
$days = $time.days
Write-Host $days
dsmod user "$userDN" -acctexpires $days
}
}
I am getting a DSMOD error so Im thinking it is something simple im overlooking. I do get the popup asking me to input the date I want it to expire.
Thanks for any help,