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