Is it possible to create a DSN on a remote server in C#
I am trying to create a script such that I am given an array of server names and from these names I would like to create a system dsn on each of those respective machines.
I know that you can use SQLConfigDataSource() to create a dsn on your l开发者_开发技巧ocal machine, but it does not seem to give any parameters for creating the dsn on a separate machine.
Are there any functions that can achieve this result?
I would recommend using ps-exec for a task like this.
You can definitely do it, worst case you could just write the registry entries manually. To do that download Process Monitor, set it up to monitor registry changes and then create the DSN locally and you'll see what settings you need to change.
Here's an article discussing that approach also (from a script perspective, but should be easy to do in C#).
精彩评论