1

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?

Myles Gray
  • 8,711
  • 7
  • 48
  • 70
  • What is the operating system on the targets? Have you thought about PowerShell? WMI certainly doesn't seem like the answer here. – Aaron Bertrand Aug 24 '11 at 16:18
  • @Aaron - The client OS is XP - Target OS is Server 2003 Standard - To be honest no I hadn't thought about PowerShell - I know very little about it - I really need to set up a client/server sort of connection over the internet with authentication - Telnet came to mind but I don't know if server 03 allows telnet control of cmd? – Myles Gray Aug 24 '11 at 16:44

1 Answers1

1

Telnet should work. If you don't have it enabled, this link shows how. http://www.petri.co.il/enable_telnet_on_windows_2003.htm

atrueresistance
  • 1,358
  • 5
  • 26
  • 48
  • I have been looking around but can't find a way to get telnet to load command.COM? – Myles Gray Aug 24 '11 at 20:56
  • @MylesGray Telnet sends your commands and input/output [in plain text](http://technet.microsoft.com/en-us/library/cc755017%28v=ws.10%29.aspx). Be careful. – jpmc26 Mar 28 '14 at 18:42