Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to check account access to about 700 servers with Windows Server 2003.
We had access to all these servers, but over the years some of the servers changed owners and my group no longer have access to those servers. Now I have to check which servers we no longer suport.
The only method I know is to login via Remote Desktop, but there must be some way to do it automatically.
Could you tell me is there a way of simply checking access to server from any kind of programing language or script?

share|improve this question

I Suggest you check out this link. I would think it will give an error that you can catch when the connection fails.

share|improve this answer

If you want to kick it old school, you can do this with a list of servers (dumped from AD?) and batch.

for /f "tokens=* delims= " %%s in (servers.txt) do (
sc \\%%s query "W32Time" | findstr /c:"FAILED"
if errorlevel 1 echo %%s >> access.txt

for /f "tokens=* delims= " %%a in (servers.txt) do (
find "%%a" < access.txt > nul
if errorlevel 1 echo %%a >> accessdenied.txt

There are probably easy ways to do it in other languages, too, but I had that one lying around.

You may have to tweak the service and the error string for your environment.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.