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
MDMarra
  • 100,734
  • 32
  • 197
  • 329
Matt
  • 85
  • 2
  • 7

1 Answers1

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.

Ryan Ries
  • 55,481
  • 10
  • 142
  • 199