I have a script to check expired user in my Domain.

I am checking expired user <= the day I run the script,

Now I need to modify the script to display the user expired 30 days before the run date
ie: today is 22/10/2008 I need to display user expired on 22/09/2008 or before

Please find the current script:


 PHP:
Break ON ;$null=RedirectOutput("D:\expired.txt") $pcpool = GetObject("WinNT://@Domain");Connect to domain If @ERROR=0 AND VarType($pcpool) = 9 ;Confirm connection For Each $user In $pcpool If $user.class="User" $=Execute("Exit 0") ; Reset error flag $Expired=$User.AccountExpirationDate If NOT @ERROR ; Reformat date to suitable (from European format) $aDate=Split($Expired,"/") $dt1=@date $syy = Left($dt1,4) $smm = SubStr($dt1,6,2) $sdd = SubStr($dt1,9,2) $sresult=$syy + $smm + $sdd If CStr($aDate[2])+$aDate[1]+$aDate[0] <= $sresult ? $user.name + " "+ $Expired EndIf EndIf EndIf Next Else ? @ERROR ? ? @SERROR EndIf


Edited by Saleem (2008-10-22 01:17 PM)
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran