Converting mailboxes

The following code sample converts a user mailbox into a room mailbox.

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

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

$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"

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

# Convert mailbox.
$user.ConvertMailboxTo("ADM_MAILBOXTYPEFORCONVERSION_ROOM")

See also