Welcome!

I use Microsoft System Center Data Protection Manager 2007 on a daily basis, and although it is a great product, it takes a lot to master. I have created this blog to share my experiences with DPM with other System Administrators out there. All of my experience with DPM is in the role of protecting Microsoft Exchange 2007, and SQL server (the DPM database itself).

There have been many issues that I've run across, and not been able to find answers for on the Internet, so I'm going to "pay it forward" to the IT community!

Hope you find this blog informative!

Tuesday, August 25, 2009

Use Excel to create easy batch jobs

Do you have to run a command on several servers remotely?  You can enter each command separately, but every good admin should know how to make life easier for him/her self.  For example, I wanted to use the psloggedon.exe tool to find out who was logged in to all the servers I manage (about 150).  Naturally, I could log into each server, check the Terminal Server Manager, and go on the next, but who wants to do that? 

The PSTool – psloggedon.exe is a nice little utility that I can run from my command prompt, and have it query a remote computer, returning who is logged on to that server.  So, starting in Excel (I already had a list of all the servers), I pasted the list of servers in the C column.

Next, in Column A, I entered "psloggedon.exe” – the name of the executable I want to run.  in Column B, I put a “ \\” – note the space in front of the \\.  In column E, I entered my first switch, “ –l” – and in column F, a second switch “ –x” again, note the spaces before the switches.

 image image

Now, to bring the whole thing together.  I LOVE the command Concatenate. 

image

In column G, I entered =concatenate(A1,B1,C1,D1,E1)

image

This will combine all the columns together (now you know why the spaces were above) for your final command.

image

You can now select column G, and copy and paste it into notepad, and save it as a .bat file.  You now have an easily made bat file, using Excel.

0 comments: