Master XML configuration file for same script on multiple servers

I have a script that collects system and SharePoint-related data from a server and emails it to a mailbox. The XML configuration file it reads contains the following values:

<settings>
	<client>PAN001</client>
	
	<smtp>
		<to>john.citizen@domain.com</to>
		<from>bob.bee@domain.com</from>
		
		<server>smtp</server>
		<port>587</port>
		<username>username</username>
		<password>password</password>
		<enablessl>true</enablessl>	
	</smtp>
</settings>

The <client> node will be configured depending on the server while the nodes under <smtp> will always stay the same. The problem is I have to deploy this script to 10 farms (approximately 20 or more servers). If I had to change, for example, the username and password nodes, I would have to do this for each server that hosts my scripts.

I was thinking of doing was uploading the configuration file to a central location and have the script download the configuration file each time, but it's not safe to assume that each of the servers will have access to this this "central location" or even the internet at all.

What would be the best method of doing this?

April 10th, 2014 6:59pm

You are not really going to put a password in a text file and place it on a web server are you?

This sounds like a better job for a database to centrally manage the shared data.

Free Windows Admin Tool Kit Click here and download it now
April 10th, 2014 9:32pm

Use sharepoint mail instead of external mail. You should be able to set up mail under the sharepoint admin.

April 10th, 2014 9:35pm

Initially yes and I do realize that this is bad practice.

Correct me if I'm wrong but, the most ideal way of handling passwords would be to prompt the user to type in their credentials and convert the password into a secure string. In this situation, the script is going to be executed by the Task Scheduler so the username will have to be stored somewhere. How can I make this more secure?

Note: The username and password that is being stored there is to log into the external SMTP server so I cannot use NetworkCredential like I usually would.



Free Windows Admin Tool Kit Click here and download it now
April 11th, 2014 1:29am

You can set tasks in the task scheduler with Group Policy Preferences.

If you are using Exchange you do not need to log into the SMTP server if you are in the domain. If you are using a third party service then you can store the password encrypted in the XML file.

You could also consider using the DSC tools to maintain this info across servers.  Just make changes and rerun the tool.

The XML is OK.  You just need to distribute.  Copying it to all servers is not a bad idea just start with an encrypted password.

April 11th, 2014 1:54am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics