troubleshooting Question

How to run a SQL query for all machines in an OU

Avatar of sweetaz
sweetaz asked on
Windows XPActive DirectoryShell Scripting
4 Comments1 Solution311 ViewsLast Modified:
I have a SQL query that I need to run on all machines in an OU in a W2k3 Server Windows XP environment.
The .bat is located in the netlogon share of the DC and is as follows:

cd Program Files\Microsoft SQL Server\80\Tools\Binn                  
OSQL -S (local) -d BOData -E -i \\dc\netlogon\query1.sql
REM KEY-S [server] -d [database] -E [trusted connection] -I [input file]
OSQL -S (local) -d POSLocal -E -i \\dc\netlogon\query1.sql
REM KEY-S [server] -d [database] -E [trusted connection] -I [input file]


I want to run this without user input and users do not have admin privelges. Can anyone explain to me a way to achieve this?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros