Just to show you all how crazy I am, - actually when you only know enough to be dangerous, but not enough to be proficient, you tend to do everything the hard way – here is the finished product. I’m sure there could have been a better way.
Step
1. get a list of users on a Citrix server
2. get the user’s home directory
3. search for files from a specific server
4. use kiXtart to search the file name for a specific date
5. and print out the file name with full path to the users home directory.
Command
for /f "skip=1 tokens=1-2 delims=> " %i in ('quser') do @for /f "tokens=1-3 delims= " %k in ('net user %i /domain ^| find /i "home"') do @for /f %n in ('@dir %m\*.* /s /b ^| find /i "ctxfia"') do @kix32 FileDate.kix $FN="%n" $DLF="2005_05_27"
KiXtart
Code:
$Myarray = Split($FN,"@@")
$x = RIGHT($Myarray[0], 10)
If $x = $DLF
? $FN
EndIf