<p>As a temporary stopgap until all the designers are in place we are currently hand-cranking a whole bunch of xml configuration files at work. One of the issues with this is file-versioning because people forget to update version numbers when updating the files (which is to be expected as humans generally suck at perfection).</p>

<p>Therefore I figure that as we store the files in Sharepoint I should be able to write a script to pull the files down from Sharepoint, get the version number and automatically enter/update the version number from Sharepoint into the file. This means when someone wants the "latest" files they can run the script and get the latest files with the version numbers correct (there is slightly more to it than this so the reason for using the script isn't just the benefit of auto-versioning).</p>

<p>Does anyone know how to get the files + version numbers from Sharepoint?</p>

[{'answer_id': 33299, 'author': 'kemiller2002', 'author_id': 1942, 'author_profile': 'https://Stackoverflow.com/users/1942', 'pm_score': 2, 'selected': False, 'text': "<p>Active Directory is pretty efficient at storing information and the retrieval shouldn't be that much of a performance hit.  If you are really intent on storing the names, you'll probably want to store them in some sort of a tree stucture, so you can see the relationships of all the people.  Depending on how the number of people, you might as well pull all the information you need daily and then query all the requests against your cached copy.  </p>\n"}, {'answer_id': 36730, 'author': 'Phil Bennett', 'author_id': 2995, 'author_profile': 'https://Stackoverflow.com/users/2995', 'pm_score': 2, 'selected': False, 'text': "<p>AD does that sort of caching for you so don't worry about it unless performance becomes a problem.  I have software doing this sort of thing all day long running on a corporate intranet that takes thousands of hits per hour and have never had to tune performance in this area.  </p>\n"}, {'answer_id': 39091, 'author': 'Erick Sgarbi', 'author_id': 4171, 'author_profile': 'https://Stackoverflow.com/users/4171', 'pm_score': 3, 'selected': True, 'text': '<p>In order to take control over the properties that you want to be cached you can call \'RefreshCache()\' passing the properties that you want to hang around:</p>\n\n<pre class="lang-c# prettyprint-override"><code>System.DirectoryServices.DirectoryEntry entry = new System.DirectoryServices.DirectoryEntry();               \n\n// Push the property values from AD back to cache.\n\nentry.RefreshCache(new string[] {"cn", "www" });\n</code></pre>\n'}, {'answer_id': 39099, 'author': 'Guy', 'author_id': 993, 'author_profile': 'https://Stackoverflow.com/users/993', 'pm_score': 2, 'selected': False, 'text': '<p>Depends on how up to date you want the information to be.  If you <strong>must have</strong> the very latest data in your report then querying directly from AD is reasonable.  And I agree that AD is quite robust, a typical dedicated AD server is actually very lightly utilised in normal day to day operations <em>but best to check with your IT department / support person.</em></p>\n\n<p>An alternative is to have a daily script to dump the AD data into a CSV file and/or import it into a SQL database.  (Oracle has a SELECT CONNECT BY feature that can automatically create multi-level hierarchies within a result set.  MSSQL can do a similar thing with a bit of recursion IIRC).</p>\n'}]
['https://Stackoverflow.com/questions/33252', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1143/']