Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Update 03/09/2015</h2> <p>There is no need to write custom WMI scripts anymore; PowerShell cmdlets available beginning with VisualSVN Server 3.4 cover the most Subversion server administration and repositories management use cases. Read about the new feature at <a href="https://www.visualsvn.com/server/features/powershell/" rel="nofollow noreferrer">https://www.visualsvn.com/server/features/powershell/</a></p> <p>VisualSVN Server 3.4 introduces PowerShell module that provides you with a number of helpful cmdlets. The cmdlets can be used for administering VisualSVN Server and its repositories either locally or remotely. Here is the <a href="https://www.visualsvn.com/support/topic/00088/" rel="nofollow noreferrer">complete reference on VisualSVN Server PowerShell cmdlets</a>.</p> <p>For example,</p> <ul> <li><p>You can create a new repository <em>MySuperRepo</em> by running this PowerShell command:</p> <p><code>New-SvnReposiory MySuperRepo</code></p></li> <li><p>You can create a project structure in the repository</p> <p><code>New-SvnRepositoryItem MySuperRepo -Path /branches, /tags, /trunk -Type Folder</code></p></li> <li><p>You can provide DOMAIN\Developers Active Directory group account with Read / Write access to the new repository</p> <p><code>Add-SvnAccessRule MyRepo -Path / -AccountName DOMAIN\Developers -Access ReadWrite</code></p></li> <li><p>You can calculate the size the repository takes on disk:</p> <p><code>Measure-SvnRepository MySuperRepo</code></p></li> <li><p>You can verify the repository for corruptions:</p> <p><code>Test-SvnRepository MySuperRepo</code></p> <p><strong><em>And much, much more!</em></strong></p></li> </ul> <p>For more information and the complete list of cmdlets, read the article <a href="https://www.visualsvn.com/support/topic/00088/" rel="nofollow noreferrer">VisualSVN Server PowerShell Cmdlet Reference</a>.</p> <hr> <p>VisualSVN Server can be managed via WMI (Windows Management Instrumentation) interface.</p> <p>MOF file which describes the VisualSVN Server interface resides in the <strong>%VISUALSVN_SERVER%\WMI</strong> on the computer where VisualSVN Server is installed. Using this file as a reference you can write a C# script to manage VisualSVN Server.</p> <p>Please check the MSDN article: <a href="http://msdn.microsoft.com/library/aa394582" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb404655</a></p> <p>I'm including the following samples for your reference:</p> <ul> <li><p>This C# code will create a Subversion user 'user1' with password 'secret'.</p> <pre><code> ManagementClass userClass = new ManagementClass("root\\VisualSVN", "VisualSVN_User", null); // Obtain in-parameters for the method ManagementBaseObject inParams = userClass.GetMethodParameters("Create"); // Add the input parameters. inParams["Name"] = "user1"; inParams["Password"] = "secret"; // Execute the method and obtain the return values. ManagementBaseObject outParams = userClass.InvokeMethod("Create", inParams, null); </code></pre></li> <li><p>This C# code will create a new repository 'Repo1'.</p> <pre><code> ManagementClass repoClass = new ManagementClass("root\\VisualSVN", "VisualSVN_Repository", null); // Obtain in-parameters for the method ManagementBaseObject inParams = repoClass.GetMethodParameters("Create"); // Add the input parameters. inParams["Name"] = "Repo1"; // Execute the method and obtain the return values. ManagementBaseObject outParams = repoClass.InvokeMethod("Create", inParams, null); </code></pre></li> <li><p>This C# code will provide SID S-1-5-32-545 ('BUILTIN\Users') with Read / Write access to repository 'Test'. FYI: The AccessLevel values are as described in the MOF: <em>"0 - no access, 1 - read only, 2 - read/write"</em>.</p> <pre><code>ManagementClass userClass = new ManagementClass("root\\VisualSVN", "VisualSVN_WindowsAccount", null); ManagementClass authzClass = new ManagementClass("root\\VisualSVN", "VisualSVN_SecurityDescriptor", null); ManagementClass permClass = new ManagementClass("root\\VisualSVN", "VisualSVN_PermissionEntry", null); ManagementObject userObject = userClass.CreateInstance(); userObject.SetPropertyValue("SID", "S-1-5-32-545"); ManagementObject permObject = permClass.CreateInstance(); permObject.SetPropertyValue("Account", userObject); permObject.SetPropertyValue("AccessLevel", 2); ManagementObject repo = new ManagementObject("VisualSVN_Repository.Name='Test'"); ManagementBaseObject inParams = authzClass.GetMethodParameters("SetSecurity"); inParams["Object"] = repo; inParams["Permissions"] = new object[] { permObject }; ManagementBaseObject outParams = authzClass.InvokeMethod("SetSecurity", inParams, null); </code></pre></li> </ul> <hr> <p><strong>Updated on 02/10/2013:</strong></p> <p>WMI schema has been changed (and improved!) in VisualSVN Server 2.6. In short, to set access permissions on a repository path, you are required to:</p> <ul> <li>create <code>VisualSVN_Repository</code> class object specifying repository name,</li> <li>create <code>VisualSVN_PermissionEntry</code> entry object specifying account username and access permissions,</li> <li><p>invoke <code>SetSecurity</code> method on <code>VisualSVN_Repository</code> passing valid repository path and PermissionEntry object.</p> <pre><code> ManagementClass userClass = new ManagementClass("root\\VisualSVN", "VisualSVN_WindowsAccount", null); ManagementClass permClass = new ManagementClass("root\\VisualSVN", "VisualSVN_PermissionEntry", null); ManagementClass repoClass = new ManagementClass("root\\VisualSVN", "VisualSVN_Repository", null); ManagementObject userObject = userClass.CreateInstance(); userObject.SetPropertyValue("SID", "S-1-5-32-545"); ManagementObject permObject = permClass.CreateInstance(); permObject.SetPropertyValue("Account", userObject); permObject.SetPropertyValue("AccessLevel", 2); ManagementObject repoObject = repoClass.CreateInstance(); repoObject.SetPropertyValue("Name", "MyProject"); ManagementBaseObject inParams = repoClass.GetMethodParameters("SetSecurity"); inParams["Path"] = "/trunk"; inParams["Permissions"] = new object[] { permObject }; ManagementBaseObject outParams = repoObject.InvokeMethod("SetSecurity", inParams, null); </code></pre></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload