Skip to content

IAdmUser3

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

Inheritance: The IAdmUser3 interface inherits from the IAdmUser2 interface.

Methods

Details

ArchiveHomeDirectory()

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

void ArchiveHomeDirectory(String archiveFilePath, Int32 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.

[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
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

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

# Archive the user's home directory
$user.ArchiveHomeDirectory($archivePath, $compressionLevel)
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 Int32 compressionLevel = 1;

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

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

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

Requirements

Minimum required version: 2015

See also