IAdmConfigurationQueries
The IAdmConfigurationQueries interface provides access to information about Adaxes configuration objects.
Inheritance: IUnknown
Methods
-
Method
-
Description
-
GetCustomCommandsInfo()
-
Returns an array of interfaces, each describing a custom command defined within the Adaxes service.
-
GetEffectivePropertyPatterns()
-
Returns an array of interfaces describing property patterns effective for the specified directory object.
-
GetEffectivePropertyPatternsEx()
-
Returns an array of interfaces describing property patterns effective for the specified directory objects.
Details
GetCustomCommandsInfo()
Returns an array of interfaces, each describing a custom command defined within the Adaxes service.
IAdmCustomCommandInfo[] GetCustomCommandsInfo(bool onlyEnabledCommands)
Parameters
The onlyEnabledCommands parameter specifies whether only enabled custom commands must be returned.
Examples
The following code sample outputs name and ID of each custom command defined within Adaxes service.
- PowerShell
-
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # Connect to the Adaxes service $ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace") $service = $ns.GetServiceDirectly("localhost") # Get information about custom commands $configurationQueries = $service.GetConfigurationQueries() $customCommandsInfo = $configurationQueries.GetCustomCommandsInfo($false) foreach ($info in $customCommandsInfo) { Write-Host "Name:" $info.Name Write-Host "ID:" $info.ID Write-Host }
- C#
-
using System; using Softerra.Adaxes.Adsi; using Softerra.Adaxes.Interop.Adsi.CustomCommands; using Softerra.Adaxes.Interop.Adsi.Management; using Softerra.Adaxes.Interop.Adsi.PersistentObjects; class Program { static void Main(string[] args) { // Connect to the Adaxes service AdmNamespace ns = new AdmNamespace(); IAdmService2 service = (IAdmService2)ns.GetServiceDirectly("localhost"); // Get information about custom commands IAdmConfigurationQueries configurationQueries = service.GetConfigurationQueries(); IAdmCustomCommandInfo[] customCommandsInfo = (IAdmCustomCommandInfo[])configurationQueries.GetCustomCommandsInfo(false); foreach (IAdmCustomCommandInfo info in customCommandsInfo) { Console.WriteLine("Name: " + info.Name); Console.WriteLine("ID: " + info.Id); Console.WriteLine(); } } }
GetEffectivePropertyPatterns()
Returns an array of interfaces describing property patterns effective for the specified directory object.
IAdmPropertyPatternInfo[] GetEffectivePropertyPatterns(IAdmTop targetObject)
Examples
The following code sample outputs name, description and status of all property patterns affecting the given user account.
- PowerShell
-
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # Connect to the Adaxes service $ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace") $service = $ns.GetServiceDirectly("localhost") # Bind to the user $userDN = "CN=John Smith,CN=Users,DC=domain,DC=com" $user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0) # Get information about the effective property patterns $configurationQueries = $service.GetConfigurationQueries() $effectivePropertyPatterns = $configurationQueries.GetEffectivePropertyPatterns($user) Write-Host "Property patterns effective for the user:" foreach ($propertyPatternInfo in $effectivePropertyPatterns) { Write-Host "`tName:" $propertyPatternInfo.FullName Write-Host "`tDescription:" $propertyPatternInfo.Description Write-Host "`tDisabled:" $propertyPatternInfo.Disabled Write-Host }
- C#
-
using System; using Softerra.Adaxes.Adsi; using Softerra.Adaxes.Interop.Adsi; using Softerra.Adaxes.Interop.Adsi.Management; using Softerra.Adaxes.Interop.Adsi.PersistentObjects; using Softerra.Adaxes.Interop.Adsi.PropertyPatterns; class Program { static void Main(string[] args) { // Connect to the Adaxes service AdmNamespace ns = new AdmNamespace(); IAdmService2 service = (IAdmService2)ns.GetServiceDirectly("localhost"); // Bind to the user const string userPath = "Adaxes://CN=John Smith,CN=Users,DC=domain,DC=com"; IAdmTop user = (IAdmTop)service.OpenObject(userPath, null, null, 0); // Get information about the effective property patterns IAdmConfigurationQueries configurationQueries = service.GetConfigurationQueries(); IAdmPropertyPatternInfo[] effectivePropertyPatterns = (IAdmPropertyPatternInfo[])configurationQueries.GetEffectivePropertyPatterns(user); Console.WriteLine("property patterns effective for the user:"); foreach (IAdmPropertyPatternInfo propertyPatternInfo in effectivePropertyPatterns) { Console.WriteLine("\tName: " + propertyPatternInfo.FullName); Console.WriteLine("\tDescription: " + propertyPatternInfo.Description); Console.WriteLine("\tDisabled: " + propertyPatternInfo.Disabled); Console.WriteLine(); } } }
GetEffectivePropertyPatternsEx()
Returns an array of interfaces describing property patterns effective for the specified directory objects.
IAdmPropertyPatternInfo[] GetEffectivePropertyPatternsEx(string[] targetObjectPaths)
Parameters
The targetObjectPaths parameter specifies an array of ADS paths to the directory objects to retrieve property patterns for.
Examples
The following code sample outputs name, description and status of all property patterns affecting multiple user accounts.
- PowerShell
-
$user1Path = "Adaxes://CN=John Smith,CN=Users,DC=company,DC=com" $user2Path = "Adaxes://CN=Bob Jones,CN=Users,DC=company,DC=com" # Connect to the Adaxes service $ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace") $service = $ns.GetServiceDirectly("localhost") # Get information about the effective property patterns $configurationQueries = $service.GetConfigurationQueries() $effectivePropertyPatterns = $configurationQueries.GetEffectivePropertyPatternsEx(@($user1Path, $user2Path)) Write-Host "Property patterns effective for the users:" foreach ($propertyPatternInfo in $effectivePropertyPatterns) { Write-Host "`tName:" $propertyPatternInfo.FullName Write-Host "`tDescription:" $propertyPatternInfo.Description Write-Host "`tDisabled:" $propertyPatternInfo.Disabled Write-Host }
- C#
-
using System; using Softerra.Adaxes.Adsi; using Softerra.Adaxes.Interop.Adsi.Management; using Softerra.Adaxes.Interop.Adsi.PersistentObjects; using Softerra.Adaxes.Interop.Adsi.PropertyPatterns; class Program { static void Main(string[] args) { const string fisrtPath = "Adaxes://CN=John Smith,CN=Users,DC=company,DC=com"; const string secondPath = "Adaxes://CN=Bob Jones,CN=Users,DC=company,DC=com"; // Connect to the Adaxes service AdmNamespace ns = new AdmNamespace(); IAdmService2 service = (IAdmService2)ns.GetServiceDirectly("localhost"); // Get information about the effective property patterns IAdmConfigurationQueries configurationQueries = service.GetConfigurationQueries(); IAdmPropertyPatternInfo[] effectivePropertyPatterns = (IAdmPropertyPatternInfo[])configurationQueries.GetEffectivePropertyPatternsEx( new string[] { fisrtPath, secondPath }); Console.WriteLine("Property patterns effective for the users:"); foreach (IAdmPropertyPatternInfo propertyPatternInfo in effectivePropertyPatterns) { Console.WriteLine("\tName: " + propertyPatternInfo.FullName); Console.WriteLine("\tDecription: " + propertyPatternInfo.Description); Console.WriteLine("\tDisabled: " + propertyPatternInfo.Disabled); Console.WriteLine(); } } }
Requirements
Minimum required version: 2011.1