Files
ADBulk/MainWindow.axaml
T

98 lines
4.8 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ADBulkTool.MainWindow"
Title="AD Bulk Tool"
Width="1080"
Height="820"
MinWidth="940"
MinHeight="700">
<Grid Margin="14" RowDefinitions="Auto,Auto,Auto,*,Auto" RowSpacing="12">
<StackPanel Grid.Row="0" Spacing="4">
<TextBlock Text="AD Bulk Tool" FontSize="22" FontWeight="Bold" />
<TextBlock Text="Prototype: load a CSV, map the username column, preview changes, then run a dry run or execute against AD. LDAP 389 can be used for normal edits; LDAPS 636 is required for password resets." TextWrapping="Wrap" />
</StackPanel>
<Border Grid.Row="1" BorderThickness="1" Padding="10" CornerRadius="6">
<Grid ColumnDefinitions="*,90,130,210" RowDefinitions="Auto,Auto,Auto,Auto" ColumnSpacing="10" RowSpacing="8">
<StackPanel Grid.Row="0" Grid.Column="0">
<TextBlock Text="Domain controller / LDAP host" />
<TextBox x:Name="LdapHostBox" PlaceholderText="dc01.contoso.local" />
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Text="Port" />
<TextBox x:Name="LdapPortBox" Text="636" />
</StackPanel>
<CheckBox Grid.Row="0" Grid.Column="2" x:Name="UseLdapsBox" Content="Use LDAPS" IsChecked="True" VerticalAlignment="Bottom" />
<CheckBox Grid.Row="0" Grid.Column="3" x:Name="IgnoreCertBox" Content="Ignore cert errors (test only)" VerticalAlignment="Bottom" />
<StackPanel Grid.Row="1" Grid.Column="0">
<TextBlock Text="Search base DN" />
<TextBox x:Name="SearchBaseBox" PlaceholderText="DC=contoso,DC=local" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2">
<TextBlock Text="Bind username" />
<TextBox x:Name="BindUserBox" PlaceholderText="CONTOSO\adminuser or adminuser@contoso.local" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="3">
<TextBlock Text="Bind password" />
<TextBox x:Name="BindPasswordBox" PasswordChar="*" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Spacing="8">
<Button x:Name="UsePlainLdapButton" Content="Use LDAP 389 (normal edits)" Click="UsePlainLdap_Click" />
<Button x:Name="UseLdapsPresetButton" Content="Use LDAPS 636 (password edits)" Click="UseLdapsPreset_Click" />
</StackPanel>
<Button Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" x:Name="TestConnectionButton" Content="Test ports + LDAP/LDAPS" Click="TestConnection_Click" HorizontalAlignment="Left" />
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4" x:Name="ConnectionHelpBlock" Text="LDAP 389 can do normal non-password edits. LDAPS 636 is required for password reset actions." TextWrapping="Wrap" />
</Grid>
</Border>
<Border Grid.Row="2" BorderThickness="1" Padding="10" CornerRadius="6">
<Grid ColumnDefinitions="Auto,*,*,*,*" RowDefinitions="Auto,Auto,Auto" ColumnSpacing="10" RowSpacing="8">
<Button Grid.Row="0" Grid.Column="0" x:Name="LoadCsvButton" Content="Load CSV" Click="LoadCsv_Click" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Text="Username column" />
<ComboBox x:Name="UsernameColumnBox" MinWidth="160" />
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="2">
<TextBlock Text="Action" />
<ComboBox x:Name="ActionBox" MinWidth="260" SelectionChanged="ActionBox_SelectionChanged" />
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="3">
<TextBlock Text="Group name or DN" />
<TextBox x:Name="GroupBox" PlaceholderText="Only for add/remove group" />
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="4" Orientation="Horizontal" Spacing="12" VerticalAlignment="Bottom">
<CheckBox x:Name="DryRunBox" Content="Dry run" IsChecked="True" />
<Button x:Name="PreviewButton" Content="Preview" Click="Preview_Click" />
<Button x:Name="ExecuteButton" Content="Run" Click="Execute_Click" />
</StackPanel>
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" x:Name="CsvInfoBlock" Text="No CSV loaded." />
<TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" x:Name="ActionHelpBlock" Text="Choose an action. Password reset actions require LDAPS." TextWrapping="Wrap" />
</Grid>
</Border>
<Border Grid.Row="3" BorderThickness="1" Padding="10" CornerRadius="6">
<Grid RowDefinitions="Auto,*" RowSpacing="8">
<TextBlock Text="Preview / health check / results" FontWeight="Bold" />
<ListBox Grid.Row="1" x:Name="PreviewList" />
</Grid>
</Border>
<TextBlock Grid.Row="4" x:Name="StatusBlock" Text="Ready." />
</Grid>
</Window>