0

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .