IAdmUser3

The IAdmUser3 interface extends the IAdmUser interface with the ability to archive a user’s home directory to a ZIP file.

Inheritance: IAdmUser2

Methods

Details

ArchiveHomeDirectory()

Archives the user's home directory to a ZIP file.

void ArchiveHomeDirectory(string archiveFilePath, int compressionLevel)
  • archiveFilePath – Specifies the target path to the user’s home directory archive (e.g. \\SERVER\Share\JSmith.zip).
  • compressionLevel – Specifies the data compression level. The valid range is from 1 (fastest compression) to 9 (best but slowest compression).

Examples

The following code sample archives a user's home directory to a ZIP file.

PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$archivePath = "\\SERVER\share\JSmith.zip"
$compressionLevel = 1

# Connect to the Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")

# Bind to the user
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)

# Archive the user's home directory
$user.ArchiveHomeDirectory($archivePath, $compressionLevel)
C#
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;

class Program
{
    static void Main(string[] args)
    {
        const string userDN = "CN=John Smith,CN=Users,DC=domain,DC=com";
        const string archivePath = @"\\SERVER\share\JSmith.zip";
        const int compressionLevel = 1;

        // Connect to  the Adaxes service
        AdmNamespace ns = new AdmNamespace();
        IAdmService service = ns.GetServiceDirectly("localhost");

        // Bind to the user
        IAdmUser3 user = (IAdmUser3)service.OpenObject("Adaxes://" + userDN, null, null, 0);

        // Archive the user's home directory
        user.ArchiveHomeDirectory(archivePath, compressionLevel);
    }
}

Requirements

Minimum required version: 2015

See also