PowerShell-пример добавления нового подразделения:
Add-PSSnapin microsoft.sharepoint.powershell
$orgstructureAssembly = [System.Reflection.Assembly]::Load(«DocTrix.Orgstructure, Culture=Neutral, Version=1.0.0.0, PublicKeyToken=dfa381aaa63d9c7e»)
$newDepartmentInfo = New-Object DocTrix.Orgstructure.Data.NewDepartmentInfo
$newDepartmentInfo.UniqueName = «NewDepartmentLogin»
$newDepartmentInfo.Title = «DepartmentTitle»
$newDepartmentInfo.Code = «DepartmentCode»
$web = Get-SPWeb «http://<-web-url->»
# начиная с DocTrix Platform 2010 ver. 1.0.21.3775
$serviceLocator = [DocTrix.Platform.Orgstructure.OrgstructureServiceLocator]::GetCurrent($web.Site)
# Obsolete
#if ($serviceLocator -eq $Null)
#{
# $serviceLocator = [Microsoft.Practices.SharePoint.Common.ServiceLocation.SharePointServiceLocator]::GetCurrent($web.Site)
#}
$orgstructureProcess = $serviceLocator.GetInstance($orgstructureAssembly.GetType(«DocTrix.Orgstructure.BusinessLogic.IOrgstructureBusinessProcess»))
$orgstructureProcess.Initialize($web)
$newDepartmentId = $orgstructureProcess.SaveDepartment($newDepartmentInfo);
Remove-PSSnapin microsoft.sharepoint.powershell