I am trying to write a script that will check each userID on a list to see if it still exists in AD (the list is a txt file showing just a userID per line).
So far I have written in my script:
for /F "tokens=1" %%a in (source.txt) do (
dsquery user dc=d2-tdbfg,dc=com -samid "%%a"
but I am missing the part where it checks if the value returned is NULL then write something like "user X doesnt exist"
I am hoping that someone can kindly show me how to write it using for /f or vbscript. Thank you.