Private Shared Sub RemoveUserFromGroup(userDn As String, groupDn As String)
Dim proc As Process = Process.Start("dsmod", String.Format("group ""{0}"" -rmmbr ""{1}""", groupDn, userDn))
proc.WaitForExit()
If proc.ExitCode <> 0 Then
Console.WriteLine("Could not remove user {0} from group {1}", userDn, groupDn)
End If
End Sub
|