I've already gotten Perl to create an array of usernames (@ua); now I need to check to see if each one exists in Active Directory. The best way I thought of to do this is to run dsquery on each user and determine if the command exits with zero or nonzero. I wrote the following:
foreach(@ua)
{
$out = `C:\\Windows\\System32\\dsquery.exe user -samid $_`;
}
When I run this, I get a repeated list of this in the command line console:
'C:\Windows\System32\dsquery.exe' is not recognized as an internal or external command, operable program or batch file.
However, dsquery.exe is in that location, as I can prove by simply running it:
C:\verify_users>C:\Windows\System32\dsquery.exe user -samid ...
"CN=...,OU=...,OU=...,OU=...,DC=...,DC=...,DC=..."
Any thoughts?
Thanks!