One Server to multiple servers

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Raghu
Posts: 3
Joined: 04 Sep 2017 19:53

One Server to multiple servers

#1 Post by Raghu » 09 Sep 2017 06:51

Hi All,

We have a requirement in batch scripts.

We have 5 windows servers

server1
server2
server3
server4
server5

in all 5 servers we have D:\BACKUPLOG folder.

if i execute batch script from server1 it should delete all files under (D:\BACKUPLOG) in all servers.

how do we achieve it . Script needs be executed in Server1 only.

We will be scheduling it daily from task scheduler.

Thanks in advance,

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: One Server to multiple servers

#2 Post by Squashman » 09 Sep 2017 11:46

Easiest solution would be to use the UNC path with the administrative share to each server.

Code: Select all

del \\server1\D$\BACKUPLOG\*.*
del \\server2\D$\BACKUPLOG\*.*
etc....


Make sure you assign a username and password to the Windows Scheduled task and that user must have the correct permissions as well. That user must have the correct permissions to all 5 servers.

Post Reply