I have 200 laptops that I maintain - they are running a piece of software that employs SQL Replication - they all sync back to a central server - a.b.com
If one of them goes bad I need to execute some stored procedures on the SQL Server to re-initialise them, I want to script this so it can be done form the client machine.
On the SQL Server I have enabled sqlcmd
and created a batch file that invokes the .sql
file I want to execute.
I now need to be able to script the client side setup scripts so that it will run this batch file once it gets to a certain point - I have read this may be possible with WMI but I am not so sure as the server is at a URL and not actually part of the LAN.
I have tried connecting using wmic /node:a.b.com printer list status
just to test but I get invalid node
.
Is there a way using command line tools to do this?