Your post is only selecting users, you are not selecting any date info relative to the user or what’s in the CSV. Thus you can compare anything that you have not asked code. You don’t show any part of the CSV, so we see what the date string / format looks like.
You say …
Any Ideas on how to achieve this or plan this because I am new to PowerShell.
… that's all well and good, as we all had to start form somewhere, but, you should really spend the needed time getting up to speed on it, to limit / eliminate, confusions, frustration, unnecessary errors, bad habits, poor code, and hurting your system or your environment.
See these resources below and the Free eBooks / videos on this site you asked this on. Use the ‘Free Resources’ like in the side menu section and the search bar to see other posts that could be close to what you are asking for.
You are just doing a read here, so, no real damage can be done, but just saying, as you go down this path, don’t guess, read the help files, view the videos on YouTube and MSDN Channel9 on PowerShell and ADDS, files, folders, loops, compare, etc. Just search for them.
Your query is really a PowerShell with ADDS 101 thing. Something easily found using your favorite search engine. Looking for stuff like ‘PowerShell working with csv’, ‘PowerShell date compare’, ‘PowerShell compare csv dates to active directory dates’, etc. Thus getting back stuff like this…
Compare AD against CSV - https://community.idera.com/database-tools/powershell/ask_the_experts/f/active_directory__powershell_remoting-9/19887/compare-ad-against-csv
PowerShell Dates - http://www.rlmueller.net/PowerShellDates.htm
Learning this stuff.
Practice with PSKoans
PSKoans : 0.50.0
A module designed to provide a crash-course introduction to PowerShell with programming koans.
Book references, normally the ones you’ll see most recommend:
Learn Windows PowerShell in a Month of Lunches 3rd Edition
Donald W. Jones (Author), Jeffrey Hicks (Author)
Windows PowerShell Cookbook: The Complete Guide to Scripting Microsoft’s Command Shell 3rd Edition
Lee Holmes (Author)
Windows PowerShell in Action 3rd Edition
by Bruce Payette (Author), Richard Siddaway (Author)
Windows PowerShell Survival Guide
Lastly, never ever, run any code from any one from anywhere, that you do not fully understand and what it is / will do. If you do, you could seriously damage your host and or your enterprise. Learn to master the -WhatIf, -Confirm, and leveraging the Set-StrictMode are part of your development, put that in your profile. Learn about profiles, and how to use them. Learn about execution policies, what they are and how / when to use them. Fully leverage auditing, monitoring and logging of PowerShell use by all users and processes. Especially as part of your corporate risk management effort.