Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following command; its purpose is to list any services which are running under a user account within the domain and output that information into text files within a directory. Each machine will have its own text file, within that file is a list of any services running under a user account.

The command returns- "dsquery failed:A referral was returned from the server"

If sombody could please look this command over for me?

for /f "tokens=1" %1 in ('dsquery computer
"ou=Roc.Paychex.com,dc=roc,dc=paychex,dc=com" -o rdn -limit 0') do
@wmic /node:%1 /failfast:on service where (StartName!="LocalSystem"
and StartName!="NT AUTHORITY\\LocalService" and
StartName!="NT AUTHORITY\\NetworkService")
get Caption,StartName > c:\temp\svc-list-%1.txt
share|improve this question

1 Answer 1

Do you actually have an OU named roc.paychex.com inside of a domain named roc.paychex.com? I would say either omit the ou=..., bit altogether, or change ou=..., to reflect an actual OU structure in your domain.

If you actually do have an OU named roc.paychex.com in your domain, I'll delete this answer.

share|improve this answer

Your Answer

 
discard

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.