feat: add provider creation actions to diagnostics
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="2*"/>
|
<RowDefinition Height="2*"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@@ -49,7 +50,8 @@
|
|||||||
|
|
||||||
<TextBlock Text="Provider Type" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
<TextBlock Text="Provider Type" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
<ComboBox x:Name="ProviderTypeCombo"
|
<ComboBox x:Name="ProviderTypeCombo"
|
||||||
Grid.Row="1" Grid.Column="1" Margin="0,0,16,8" Height="26"/>
|
Grid.Row="1" Grid.Column="1" Margin="0,0,16,8" Height="26"
|
||||||
|
SelectionChanged="ProviderTypeCombo_SelectionChanged"/>
|
||||||
|
|
||||||
<TextBlock Text="Domain" Grid.Row="1" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
<TextBlock Text="Domain" Grid.Row="1" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
<TextBox x:Name="DomainTextBox"
|
<TextBox x:Name="DomainTextBox"
|
||||||
@@ -218,7 +220,241 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
|
|
||||||
<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,8">
|
<GroupBox x:Name="ActionsGroupBox" Header="Provider Actions" Grid.Row="4" Margin="0,0,0,8" IsEnabled="False">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock x:Name="ActionHintTextBlock"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
Foreground="Gray"
|
||||||
|
Text="Initialisiere zuerst einen Provider. Danach erscheinen hier die provider-spezifischen Anlage-Aktionen."/>
|
||||||
|
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid x:Name="NtfsActionPanel" Visibility="Collapsed">
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="Create Folder">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="New Folder Path" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="NtfsCreateFolderPathTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Parent Folder Path" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="NtfsCreateParentPathTextBox" Grid.Row="1" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Owner SIDs" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsCreateOwnerSidsTextBox" Grid.Row="2" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Reader SIDs" Grid.Row="3" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsCreateReaderSidsTextBox" Grid.Row="3" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Writer SIDs" Grid.Row="4" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsCreateWriterSidsTextBox" Grid.Row="4" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteNtfsCreateButton" Grid.Row="5" Grid.Column="1" Width="180" HorizontalAlignment="Right" Content="Create NTFS Folder" Click="ExecuteNtfsCreateButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Ensure Groups / ACLs">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Folder Path" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="NtfsEnsureFolderPathTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Owner SIDs" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsEnsureOwnerSidsTextBox" Grid.Row="1" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Reader SIDs" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsEnsureReaderSidsTextBox" Grid.Row="2" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Writer SIDs" Grid.Row="3" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="NtfsEnsureWriterSidsTextBox" Grid.Row="3" Grid.Column="1" Margin="0,0,0,8" Height="60" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<CheckBox x:Name="NtfsEnsureTraverseCheckBox" Grid.Row="4" Grid.Column="1" Margin="0,0,0,8" Content="Ensure traverse groups and ACLs on parent path"/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteNtfsEnsureButton" Grid.Row="5" Grid.Column="1" Width="220" HorizontalAlignment="Right" Content="Ensure Missing Groups / ACLs" Click="ExecuteNtfsEnsureButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid x:Name="AdActionPanel" Visibility="Collapsed">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Service Name" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="AdServiceNameTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,16,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Description" Grid.Row="0" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="AdDescriptionTextBox" Grid.Row="0" Grid.Column="3" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Group Scope" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<ComboBox x:Name="AdScopeComboBox" Grid.Row="1" Grid.Column="1" Margin="0,0,16,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Group Type" Grid.Row="1" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<ComboBox x:Name="AdGroupTypeComboBox" Grid.Row="1" Grid.Column="3" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Owner SIDs" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="AdOwnerSidsTextBox" Grid.Row="2" Grid.Column="1" Margin="0,0,16,8" Height="70" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Member SIDs" Grid.Row="2" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="AdMemberSidsTextBox" Grid.Row="2" Grid.Column="3" Margin="0,0,0,8" Height="70" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4" Margin="0,0,0,8" Foreground="Gray"
|
||||||
|
Text="Erstellt bzw. sichert die Owner- und Member-Gruppe für einen Service additiv ab."/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteAdCreateButton" Grid.Row="4" Grid.Column="3" Width="180" HorizontalAlignment="Right" Content="Ensure Service Groups" Click="ExecuteAdCreateButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid x:Name="MsTeamsActionPanel" Visibility="Collapsed">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Source Team ID" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="MsTeamsSourceTeamIdTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,16,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="New Team Name" Grid.Row="0" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="MsTeamsNewNameTextBox" Grid.Row="0" Grid.Column="3" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Description" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="MsTeamsDescriptionTextBox" Grid.Row="1" Grid.Column="1" Margin="0,0,16,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Visibility" Grid.Row="1" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<ComboBox x:Name="MsTeamsVisibilityComboBox" Grid.Row="1" Grid.Column="3" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Parts To Clone" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<WrapPanel Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,0,0,8">
|
||||||
|
<CheckBox x:Name="MsTeamsCloneAppsCheckBox" Margin="0,0,16,0" Content="Apps"/>
|
||||||
|
<CheckBox x:Name="MsTeamsCloneTabsCheckBox" Margin="0,0,16,0" Content="Tabs"/>
|
||||||
|
<CheckBox x:Name="MsTeamsCloneSettingsCheckBox" Margin="0,0,16,0" Content="Settings"/>
|
||||||
|
<CheckBox x:Name="MsTeamsCloneChannelsCheckBox" Margin="0,0,16,0" Content="Channels"/>
|
||||||
|
<CheckBox x:Name="MsTeamsCloneMembersCheckBox" Content="Members"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<TextBlock Text="Additional Members" Grid.Row="3" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="MsTeamsAdditionalMembersTextBox" Grid.Row="3" Grid.Column="1" Margin="0,0,16,8" Height="70" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Additional Owners" Grid.Row="3" Grid.Column="2" Margin="0,0,8,8" VerticalAlignment="Top"/>
|
||||||
|
<TextBox x:Name="MsTeamsAdditionalOwnersTextBox" Grid.Row="3" Grid.Column="3" Margin="0,0,0,8" Height="70" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteMsTeamsCloneButton" Grid.Row="4" Grid.Column="3" Width="140" HorizontalAlignment="Right" Content="Clone Team" Click="ExecuteMsTeamsCloneButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid x:Name="ExchangeActionPanel" Visibility="Collapsed">
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="Shared Mailbox">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Name" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeMailboxNameTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Alias" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeMailboxAliasTextBox" Grid.Row="1" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Display Name" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeMailboxDisplayNameTextBox" Grid.Row="2" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Primary SMTP" Grid.Row="3" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeMailboxPrimarySmtpTextBox" Grid.Row="3" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteExchangeMailboxButton" Grid.Row="4" Grid.Column="1" Width="190" HorizontalAlignment="Right" Content="Create Shared Mailbox" Click="ExecuteExchangeMailboxButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Distribution Group">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Name" Grid.Row="0" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeDistributionNameTextBox" Grid.Row="0" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Alias" Grid.Row="1" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeDistributionAliasTextBox" Grid.Row="1" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Display Name" Grid.Row="2" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeDistributionDisplayNameTextBox" Grid.Row="2" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Primary SMTP" Grid.Row="3" Grid.Column="0" Margin="0,0,8,8" VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="ExchangeDistributionPrimarySmtpTextBox" Grid.Row="3" Grid.Column="1" Margin="0,0,0,8" Height="26"/>
|
||||||
|
|
||||||
|
<Button x:Name="ExecuteExchangeDistributionButton" Grid.Row="4" Grid.Column="1" Width="200" HorizontalAlignment="Right" Content="Create Distribution Group" Click="ExecuteExchangeDistributionButton_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,8">
|
||||||
<Button x:Name="LoadJsonButton" Content="Load JSON" Width="110" Margin="0,0,8,0" Click="LoadJsonButton_Click"/>
|
<Button x:Name="LoadJsonButton" Content="Load JSON" Width="110" Margin="0,0,8,0" Click="LoadJsonButton_Click"/>
|
||||||
<Button x:Name="ExportJsonButton" Content="Export Sanitized JSON" Width="170" Margin="0,0,8,0" Click="ExportJsonButton_Click"/>
|
<Button x:Name="ExportJsonButton" Content="Export Sanitized JSON" Width="170" Margin="0,0,8,0" Click="ExportJsonButton_Click"/>
|
||||||
<Button x:Name="InitializeButton" Content="Initialize Provider" Width="160" Margin="0,0,8,0" Click="InitializeButton_Click"/>
|
<Button x:Name="InitializeButton" Content="Initialize Provider" Width="160" Margin="0,0,8,0" Click="InitializeButton_Click"/>
|
||||||
@@ -227,7 +463,7 @@
|
|||||||
<Button x:Name="ClearLogButton" Content="Clear Log" Width="110" Click="ClearLogButton_Click"/>
|
<Button x:Name="ClearLogButton" Content="Clear Log" Width="110" Click="ClearLogButton_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<GroupBox Header="Result" Grid.Row="5" Margin="0,0,0,8">
|
<GroupBox Header="Result" Grid.Row="6" Margin="0,0,0,8">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<TextBox x:Name="ResultTextBox"
|
<TextBox x:Name="ResultTextBox"
|
||||||
TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
|
TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
|
||||||
@@ -235,7 +471,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Session Log" Grid.Row="6">
|
<GroupBox Header="Session Log" Grid.Row="7">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ using System.IO;
|
|||||||
using C4IT.LIAM;
|
using C4IT.LIAM;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
using C4IT.Matrix42.ServerInfo;
|
using C4IT.Matrix42.ServerInfo;
|
||||||
|
using C4IT.MsGraph;
|
||||||
|
using C4IT_IAM_Engine;
|
||||||
using LiamWorkflowActivities;
|
using LiamWorkflowActivities;
|
||||||
|
using LiamAD;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
@@ -31,6 +34,8 @@ namespace LiamWorkflowDiagnostics
|
|||||||
InitializeCombos();
|
InitializeCombos();
|
||||||
MaxDepthTextBox.Text = "1";
|
MaxDepthTextBox.Text = "1";
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
UpdateProviderActionPanel();
|
||||||
|
ToggleActionButtons(true);
|
||||||
this.Closing += MainWindow_Closing;
|
this.Closing += MainWindow_Closing;
|
||||||
AppendLog("Diagnostics tool bereit.");
|
AppendLog("Diagnostics tool bereit.");
|
||||||
}
|
}
|
||||||
@@ -67,6 +72,18 @@ namespace LiamWorkflowDiagnostics
|
|||||||
|
|
||||||
GroupStrategyCombo.ItemsSource = Enum.GetValues(typeof(eLiamGroupStrategies)).Cast<eLiamGroupStrategies>();
|
GroupStrategyCombo.ItemsSource = Enum.GetValues(typeof(eLiamGroupStrategies)).Cast<eLiamGroupStrategies>();
|
||||||
GroupStrategyCombo.SelectedItem = eLiamGroupStrategies.Ntfs_AGDLP;
|
GroupStrategyCombo.SelectedItem = eLiamGroupStrategies.Ntfs_AGDLP;
|
||||||
|
AdScopeComboBox.ItemsSource = Enum.GetValues(typeof(eLiamAccessRoleScopes))
|
||||||
|
.Cast<eLiamAccessRoleScopes>()
|
||||||
|
.Where(i => i != eLiamAccessRoleScopes.Unknown);
|
||||||
|
AdScopeComboBox.SelectedItem = eLiamAccessRoleScopes.Universal;
|
||||||
|
AdGroupTypeComboBox.ItemsSource = Enum.GetValues(typeof(ADServiceGroupCreator.ADGroupType))
|
||||||
|
.Cast<ADServiceGroupCreator.ADGroupType>();
|
||||||
|
AdGroupTypeComboBox.SelectedItem = ADServiceGroupCreator.ADGroupType.Distribution;
|
||||||
|
MsTeamsVisibilityComboBox.ItemsSource = Enum.GetValues(typeof(cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType))
|
||||||
|
.Cast<cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType>();
|
||||||
|
MsTeamsVisibilityComboBox.SelectedItem = cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType.Private;
|
||||||
|
MsTeamsCloneSettingsCheckBox.IsChecked = true;
|
||||||
|
MsTeamsCloneChannelsCheckBox.IsChecked = true;
|
||||||
|
|
||||||
FetchDataAreasButton.IsEnabled = false;
|
FetchDataAreasButton.IsEnabled = false;
|
||||||
FetchSecurityGroupsButton.IsEnabled = false;
|
FetchSecurityGroupsButton.IsEnabled = false;
|
||||||
@@ -131,19 +148,17 @@ namespace LiamWorkflowDiagnostics
|
|||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
AppendLog("Provider initialisiert und authentifiziert.", LogLevels.Info);
|
AppendLog("Provider initialisiert und authentifiziert.", LogLevels.Info);
|
||||||
FetchDataAreasButton.IsEnabled = true;
|
|
||||||
FetchSecurityGroupsButton.IsEnabled = true;
|
|
||||||
ResultTextBox.Text = _session.SanitizedConfigJson;
|
ResultTextBox.Text = _session.SanitizedConfigJson;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_session = null;
|
||||||
AppendLog("Initialisierung fehlgeschlagen. Prüfe Log für Details.", LogLevels.Error);
|
AppendLog("Initialisierung fehlgeschlagen. Prüfe Log für Details.", LogLevels.Error);
|
||||||
FetchDataAreasButton.IsEnabled = false;
|
|
||||||
FetchSecurityGroupsButton.IsEnabled = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
_session = null;
|
||||||
AppendLog($"Fehler bei Initialisierung: {ex.Message}", LogLevels.Error);
|
AppendLog($"Fehler bei Initialisierung: {ex.Message}", LogLevels.Error);
|
||||||
MessageBox.Show(this, ex.ToString(), "Initialisierung fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show(this, ex.ToString(), "Initialisierung fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
@@ -158,6 +173,26 @@ namespace LiamWorkflowDiagnostics
|
|||||||
InitializeButton.IsEnabled = enabled;
|
InitializeButton.IsEnabled = enabled;
|
||||||
LoadJsonButton.IsEnabled = enabled;
|
LoadJsonButton.IsEnabled = enabled;
|
||||||
ExportJsonButton.IsEnabled = enabled;
|
ExportJsonButton.IsEnabled = enabled;
|
||||||
|
var providerReady = enabled && _session?.Provider != null;
|
||||||
|
FetchDataAreasButton.IsEnabled = providerReady;
|
||||||
|
FetchSecurityGroupsButton.IsEnabled = providerReady;
|
||||||
|
ActionsGroupBox.IsEnabled = providerReady;
|
||||||
|
UpdateActionHint();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProviderTypeCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_session?.Provider != null
|
||||||
|
&& ProviderTypeCombo.SelectedItem is eLiamProviderTypes providerType
|
||||||
|
&& _session.Provider.ProviderType != providerType)
|
||||||
|
{
|
||||||
|
_session = null;
|
||||||
|
AppendLog("Provider-Typ gewechselt. Bitte Provider neu initialisieren, bevor Calls ausgeführt werden.", LogLevels.Warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateProviderActionPanel();
|
||||||
|
ToggleActionButtons(true);
|
||||||
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClearLogButton_Click(object sender, RoutedEventArgs e)
|
private void ClearLogButton_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -225,9 +260,47 @@ namespace LiamWorkflowDiagnostics
|
|||||||
ServerNameTextBox.Text = settings.ServerName ?? string.Empty;
|
ServerNameTextBox.Text = settings.ServerName ?? string.Empty;
|
||||||
UseHttpsCheckBox.IsChecked = settings.UseHttps;
|
UseHttpsCheckBox.IsChecked = settings.UseHttps;
|
||||||
LicenseTextBox.Text = settings.License ?? string.Empty;
|
LicenseTextBox.Text = settings.License ?? string.Empty;
|
||||||
|
NtfsCreateFolderPathTextBox.Text = settings.NtfsCreateFolderPath ?? string.Empty;
|
||||||
|
NtfsCreateParentPathTextBox.Text = settings.NtfsCreateParentPath ?? string.Empty;
|
||||||
|
NtfsCreateOwnerSidsTextBox.Text = settings.NtfsCreateOwnerSids ?? string.Empty;
|
||||||
|
NtfsCreateReaderSidsTextBox.Text = settings.NtfsCreateReaderSids ?? string.Empty;
|
||||||
|
NtfsCreateWriterSidsTextBox.Text = settings.NtfsCreateWriterSids ?? string.Empty;
|
||||||
|
NtfsEnsureFolderPathTextBox.Text = settings.NtfsEnsureFolderPath ?? string.Empty;
|
||||||
|
NtfsEnsureOwnerSidsTextBox.Text = settings.NtfsEnsureOwnerSids ?? string.Empty;
|
||||||
|
NtfsEnsureReaderSidsTextBox.Text = settings.NtfsEnsureReaderSids ?? string.Empty;
|
||||||
|
NtfsEnsureWriterSidsTextBox.Text = settings.NtfsEnsureWriterSids ?? string.Empty;
|
||||||
|
NtfsEnsureTraverseCheckBox.IsChecked = settings.NtfsEnsureTraverse;
|
||||||
|
AdServiceNameTextBox.Text = settings.AdServiceName ?? string.Empty;
|
||||||
|
AdDescriptionTextBox.Text = settings.AdDescription ?? string.Empty;
|
||||||
|
AdOwnerSidsTextBox.Text = settings.AdOwnerSids ?? string.Empty;
|
||||||
|
AdMemberSidsTextBox.Text = settings.AdMemberSids ?? string.Empty;
|
||||||
|
MsTeamsSourceTeamIdTextBox.Text = settings.MsTeamsSourceTeamId ?? string.Empty;
|
||||||
|
MsTeamsNewNameTextBox.Text = settings.MsTeamsNewName ?? string.Empty;
|
||||||
|
MsTeamsDescriptionTextBox.Text = settings.MsTeamsDescription ?? string.Empty;
|
||||||
|
MsTeamsCloneAppsCheckBox.IsChecked = settings.MsTeamsCloneApps;
|
||||||
|
MsTeamsCloneTabsCheckBox.IsChecked = settings.MsTeamsCloneTabs;
|
||||||
|
MsTeamsCloneSettingsCheckBox.IsChecked = settings.MsTeamsCloneSettings;
|
||||||
|
MsTeamsCloneChannelsCheckBox.IsChecked = settings.MsTeamsCloneChannels;
|
||||||
|
MsTeamsCloneMembersCheckBox.IsChecked = settings.MsTeamsCloneMembers;
|
||||||
|
MsTeamsAdditionalMembersTextBox.Text = settings.MsTeamsAdditionalMembers ?? string.Empty;
|
||||||
|
MsTeamsAdditionalOwnersTextBox.Text = settings.MsTeamsAdditionalOwners ?? string.Empty;
|
||||||
|
ExchangeMailboxNameTextBox.Text = settings.ExchangeMailboxName ?? string.Empty;
|
||||||
|
ExchangeMailboxAliasTextBox.Text = settings.ExchangeMailboxAlias ?? string.Empty;
|
||||||
|
ExchangeMailboxDisplayNameTextBox.Text = settings.ExchangeMailboxDisplayName ?? string.Empty;
|
||||||
|
ExchangeMailboxPrimarySmtpTextBox.Text = settings.ExchangeMailboxPrimarySmtp ?? string.Empty;
|
||||||
|
ExchangeDistributionNameTextBox.Text = settings.ExchangeDistributionName ?? string.Empty;
|
||||||
|
ExchangeDistributionAliasTextBox.Text = settings.ExchangeDistributionAlias ?? string.Empty;
|
||||||
|
ExchangeDistributionDisplayNameTextBox.Text = settings.ExchangeDistributionDisplayName ?? string.Empty;
|
||||||
|
ExchangeDistributionPrimarySmtpTextBox.Text = settings.ExchangeDistributionPrimarySmtp ?? string.Empty;
|
||||||
|
|
||||||
if (Enum.IsDefined(typeof(eLiamGroupStrategies), settings.GroupStrategy))
|
if (Enum.IsDefined(typeof(eLiamGroupStrategies), settings.GroupStrategy))
|
||||||
GroupStrategyCombo.SelectedItem = (eLiamGroupStrategies)settings.GroupStrategy;
|
GroupStrategyCombo.SelectedItem = (eLiamGroupStrategies)settings.GroupStrategy;
|
||||||
|
if (Enum.IsDefined(typeof(eLiamAccessRoleScopes), settings.AdScope))
|
||||||
|
AdScopeComboBox.SelectedItem = (eLiamAccessRoleScopes)settings.AdScope;
|
||||||
|
if (Enum.IsDefined(typeof(ADServiceGroupCreator.ADGroupType), settings.AdGroupType))
|
||||||
|
AdGroupTypeComboBox.SelectedItem = (ADServiceGroupCreator.ADGroupType)settings.AdGroupType;
|
||||||
|
if (Enum.IsDefined(typeof(cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType), settings.MsTeamsVisibility))
|
||||||
|
MsTeamsVisibilityComboBox.SelectedItem = (cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType)settings.MsTeamsVisibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveSettings()
|
private void SaveSettings()
|
||||||
@@ -264,7 +337,42 @@ namespace LiamWorkflowDiagnostics
|
|||||||
ServerName = ServerNameTextBox.Text ?? string.Empty,
|
ServerName = ServerNameTextBox.Text ?? string.Empty,
|
||||||
UseHttps = UseHttpsCheckBox.IsChecked ?? false,
|
UseHttps = UseHttpsCheckBox.IsChecked ?? false,
|
||||||
License = LicenseTextBox.Text ?? string.Empty,
|
License = LicenseTextBox.Text ?? string.Empty,
|
||||||
GroupStrategy = GroupStrategyCombo.SelectedItem is eLiamGroupStrategies gs ? (int)gs : (int)eLiamGroupStrategies.Ntfs_AGDLP
|
GroupStrategy = GroupStrategyCombo.SelectedItem is eLiamGroupStrategies gs ? (int)gs : (int)eLiamGroupStrategies.Ntfs_AGDLP,
|
||||||
|
NtfsCreateFolderPath = NtfsCreateFolderPathTextBox.Text ?? string.Empty,
|
||||||
|
NtfsCreateParentPath = NtfsCreateParentPathTextBox.Text ?? string.Empty,
|
||||||
|
NtfsCreateOwnerSids = NtfsCreateOwnerSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsCreateReaderSids = NtfsCreateReaderSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsCreateWriterSids = NtfsCreateWriterSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsEnsureFolderPath = NtfsEnsureFolderPathTextBox.Text ?? string.Empty,
|
||||||
|
NtfsEnsureOwnerSids = NtfsEnsureOwnerSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsEnsureReaderSids = NtfsEnsureReaderSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsEnsureWriterSids = NtfsEnsureWriterSidsTextBox.Text ?? string.Empty,
|
||||||
|
NtfsEnsureTraverse = NtfsEnsureTraverseCheckBox.IsChecked ?? false,
|
||||||
|
AdServiceName = AdServiceNameTextBox.Text ?? string.Empty,
|
||||||
|
AdDescription = AdDescriptionTextBox.Text ?? string.Empty,
|
||||||
|
AdScope = AdScopeComboBox.SelectedItem is eLiamAccessRoleScopes scope ? (int)scope : (int)eLiamAccessRoleScopes.Universal,
|
||||||
|
AdGroupType = AdGroupTypeComboBox.SelectedItem is ADServiceGroupCreator.ADGroupType groupType ? (int)groupType : (int)ADServiceGroupCreator.ADGroupType.Distribution,
|
||||||
|
AdOwnerSids = AdOwnerSidsTextBox.Text ?? string.Empty,
|
||||||
|
AdMemberSids = AdMemberSidsTextBox.Text ?? string.Empty,
|
||||||
|
MsTeamsSourceTeamId = MsTeamsSourceTeamIdTextBox.Text ?? string.Empty,
|
||||||
|
MsTeamsNewName = MsTeamsNewNameTextBox.Text ?? string.Empty,
|
||||||
|
MsTeamsDescription = MsTeamsDescriptionTextBox.Text ?? string.Empty,
|
||||||
|
MsTeamsVisibility = MsTeamsVisibilityComboBox.SelectedItem is cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType visibility ? (int)visibility : (int)cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType.Private,
|
||||||
|
MsTeamsCloneApps = MsTeamsCloneAppsCheckBox.IsChecked ?? false,
|
||||||
|
MsTeamsCloneTabs = MsTeamsCloneTabsCheckBox.IsChecked ?? false,
|
||||||
|
MsTeamsCloneSettings = MsTeamsCloneSettingsCheckBox.IsChecked ?? true,
|
||||||
|
MsTeamsCloneChannels = MsTeamsCloneChannelsCheckBox.IsChecked ?? true,
|
||||||
|
MsTeamsCloneMembers = MsTeamsCloneMembersCheckBox.IsChecked ?? false,
|
||||||
|
MsTeamsAdditionalMembers = MsTeamsAdditionalMembersTextBox.Text ?? string.Empty,
|
||||||
|
MsTeamsAdditionalOwners = MsTeamsAdditionalOwnersTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeMailboxName = ExchangeMailboxNameTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeMailboxAlias = ExchangeMailboxAliasTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeMailboxDisplayName = ExchangeMailboxDisplayNameTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeMailboxPrimarySmtp = ExchangeMailboxPrimarySmtpTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeDistributionName = ExchangeDistributionNameTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeDistributionAlias = ExchangeDistributionAliasTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeDistributionDisplayName = ExchangeDistributionDisplayNameTextBox.Text ?? string.Empty,
|
||||||
|
ExchangeDistributionPrimarySmtp = ExchangeDistributionPrimarySmtpTextBox.Text ?? string.Empty
|
||||||
};
|
};
|
||||||
|
|
||||||
var directory = Path.GetDirectoryName(_settingsPath);
|
var directory = Path.GetDirectoryName(_settingsPath);
|
||||||
@@ -285,6 +393,72 @@ namespace LiamWorkflowDiagnostics
|
|||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateProviderActionPanel()
|
||||||
|
{
|
||||||
|
NtfsActionPanel.Visibility = Visibility.Collapsed;
|
||||||
|
AdActionPanel.Visibility = Visibility.Collapsed;
|
||||||
|
MsTeamsActionPanel.Visibility = Visibility.Collapsed;
|
||||||
|
ExchangeActionPanel.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
if (!(ProviderTypeCombo.SelectedItem is eLiamProviderTypes providerType))
|
||||||
|
{
|
||||||
|
UpdateActionHint();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (providerType)
|
||||||
|
{
|
||||||
|
case eLiamProviderTypes.Ntfs:
|
||||||
|
NtfsActionPanel.Visibility = Visibility.Visible;
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.ActiveDirectory:
|
||||||
|
AdActionPanel.Visibility = Visibility.Visible;
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.MsTeams:
|
||||||
|
MsTeamsActionPanel.Visibility = Visibility.Visible;
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.Exchange:
|
||||||
|
ExchangeActionPanel.Visibility = Visibility.Visible;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateActionHint();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateActionHint()
|
||||||
|
{
|
||||||
|
if (!(ProviderTypeCombo.SelectedItem is eLiamProviderTypes providerType))
|
||||||
|
{
|
||||||
|
ActionHintTextBlock.Text = "Waehle einen Provider-Typ aus.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var providerReady = _session?.Provider != null;
|
||||||
|
var providerHint = string.Empty;
|
||||||
|
switch (providerType)
|
||||||
|
{
|
||||||
|
case eLiamProviderTypes.Ntfs:
|
||||||
|
providerHint = "NTFS: neue Ordner anlegen oder auf bestehenden Ordnern fehlende Berechtigungsgruppen und ACLs additiv sicherstellen.";
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.ActiveDirectory:
|
||||||
|
providerHint = "Active Directory: Owner- und Member-Gruppen fuer einen Service anhand der konfigurierten Namenskonvention sicherstellen.";
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.MsTeams:
|
||||||
|
providerHint = "Microsoft Teams: Team-Clone mit steuerbaren Clone-Bestandteilen ausfuehren.";
|
||||||
|
break;
|
||||||
|
case eLiamProviderTypes.Exchange:
|
||||||
|
providerHint = "Exchange: Shared Mailbox oder Distribution Group inklusive Ownership-Gruppen erzeugen.";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
providerHint = "Fuer diesen Provider sind keine Anlage-Aktionen hinterlegt.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionHintTextBlock.Text = providerReady
|
||||||
|
? providerHint
|
||||||
|
: $"Initialisiere zuerst einen Provider. {providerHint}";
|
||||||
|
}
|
||||||
|
|
||||||
private async void FetchDataAreasButton_Click(object sender, RoutedEventArgs e)
|
private async void FetchDataAreasButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (_session?.Provider == null)
|
if (_session?.Provider == null)
|
||||||
@@ -336,6 +510,148 @@ namespace LiamWorkflowDiagnostics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void ExecuteNtfsCreateButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("NTFS Folder Create", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderNtfs>("NTFS");
|
||||||
|
var folderPath = GetRequiredText(NtfsCreateFolderPathTextBox.Text, "New Folder Path");
|
||||||
|
var parentPath = NormalizeOptionalText(NtfsCreateParentPathTextBox.Text);
|
||||||
|
if (string.IsNullOrWhiteSpace(parentPath))
|
||||||
|
{
|
||||||
|
parentPath = Directory.GetParent(folderPath)?.FullName;
|
||||||
|
}
|
||||||
|
if (string.IsNullOrWhiteSpace(parentPath))
|
||||||
|
throw new InvalidOperationException("Parent Folder Path konnte nicht ermittelt werden.");
|
||||||
|
|
||||||
|
var result = await provider.CreateDataAreaAsync(
|
||||||
|
folderPath,
|
||||||
|
parentPath,
|
||||||
|
ParseKeyValueLines(CustomTagsTextBox.Text, "Custom Tags"),
|
||||||
|
ParseIdentifierList(NtfsCreateOwnerSidsTextBox.Text, "Owner SIDs"),
|
||||||
|
ParseIdentifierList(NtfsCreateReaderSidsTextBox.Text, "Reader SIDs"),
|
||||||
|
ParseIdentifierList(NtfsCreateWriterSidsTextBox.Text, "Writer SIDs"));
|
||||||
|
|
||||||
|
return MapResultToken(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteNtfsEnsureButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("NTFS Ensure Groups / ACLs", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderNtfs>("NTFS");
|
||||||
|
var folderPath = GetRequiredText(NtfsEnsureFolderPathTextBox.Text, "Folder Path");
|
||||||
|
var result = await provider.EnsureMissingPermissionGroupsAsync(
|
||||||
|
folderPath,
|
||||||
|
ParseKeyValueLines(CustomTagsTextBox.Text, "Custom Tags"),
|
||||||
|
ParseIdentifierList(NtfsEnsureOwnerSidsTextBox.Text, "Owner SIDs"),
|
||||||
|
ParseIdentifierList(NtfsEnsureReaderSidsTextBox.Text, "Reader SIDs"),
|
||||||
|
ParseIdentifierList(NtfsEnsureWriterSidsTextBox.Text, "Writer SIDs"),
|
||||||
|
NtfsEnsureTraverseCheckBox.IsChecked ?? false);
|
||||||
|
|
||||||
|
return MapResultToken(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteAdCreateButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("AD Ensure Service Groups", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderAD>("Active Directory");
|
||||||
|
var serviceName = GetRequiredText(AdServiceNameTextBox.Text, "Service Name");
|
||||||
|
var description = NormalizeOptionalText(AdDescriptionTextBox.Text);
|
||||||
|
var scope = AdScopeComboBox.SelectedItem is eLiamAccessRoleScopes selectedScope
|
||||||
|
? selectedScope
|
||||||
|
: eLiamAccessRoleScopes.Universal;
|
||||||
|
var groupType = AdGroupTypeComboBox.SelectedItem is ADServiceGroupCreator.ADGroupType selectedType
|
||||||
|
? selectedType
|
||||||
|
: ADServiceGroupCreator.ADGroupType.Distribution;
|
||||||
|
var ownerSids = ParseIdentifierList(AdOwnerSidsTextBox.Text, "Owner SIDs");
|
||||||
|
var memberSids = ParseIdentifierList(AdMemberSidsTextBox.Text, "Member SIDs");
|
||||||
|
|
||||||
|
var result = await Task.Run(() => provider.CreateServiceGroups(
|
||||||
|
serviceName,
|
||||||
|
description,
|
||||||
|
scope,
|
||||||
|
groupType,
|
||||||
|
ownerSids,
|
||||||
|
memberSids));
|
||||||
|
|
||||||
|
return MapSecurityGroupResults(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteMsTeamsCloneButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("MsTeams Clone Team", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderMsTeams>("MsTeams");
|
||||||
|
var sourceTeamId = GetRequiredText(MsTeamsSourceTeamIdTextBox.Text, "Source Team ID");
|
||||||
|
var newTeamName = GetRequiredText(MsTeamsNewNameTextBox.Text, "New Team Name");
|
||||||
|
var visibility = MsTeamsVisibilityComboBox.SelectedItem is cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType selectedVisibility
|
||||||
|
? selectedVisibility
|
||||||
|
: cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType.Private;
|
||||||
|
|
||||||
|
var result = await provider.cloneTeam(
|
||||||
|
sourceTeamId,
|
||||||
|
newTeamName,
|
||||||
|
NormalizeOptionalText(MsTeamsDescriptionTextBox.Text),
|
||||||
|
(int)visibility,
|
||||||
|
GetSelectedCloneParts(),
|
||||||
|
string.Join(";", ParseIdentifierList(MsTeamsAdditionalMembersTextBox.Text, "Additional Members")),
|
||||||
|
string.Join(";", ParseIdentifierList(MsTeamsAdditionalOwnersTextBox.Text, "Additional Owners")));
|
||||||
|
|
||||||
|
return MapMsGraphResult(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteExchangeMailboxButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("Exchange Create Shared Mailbox", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderExchange>("Exchange");
|
||||||
|
var name = GetRequiredText(ExchangeMailboxNameTextBox.Text, "Name");
|
||||||
|
var alias = GetRequiredText(ExchangeMailboxAliasTextBox.Text, "Alias");
|
||||||
|
var displayName = NormalizeOptionalText(ExchangeMailboxDisplayNameTextBox.Text);
|
||||||
|
var primarySmtp = NormalizeOptionalText(ExchangeMailboxPrimarySmtpTextBox.Text);
|
||||||
|
var result = await Task.Run(() => provider.exchangeManager.CreateSharedMailboxWithOwnershipGroups(
|
||||||
|
name,
|
||||||
|
alias,
|
||||||
|
displayName,
|
||||||
|
primarySmtp));
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
ObjectGuid = result.Item1,
|
||||||
|
Groups = MapSecurityGroupResults(result.Item2)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteExchangeDistributionButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await ExecuteProviderActionAsync("Exchange Create Distribution Group", async () =>
|
||||||
|
{
|
||||||
|
var provider = EnsureInitializedProvider<cLiamProviderExchange>("Exchange");
|
||||||
|
var name = GetRequiredText(ExchangeDistributionNameTextBox.Text, "Name");
|
||||||
|
var alias = GetRequiredText(ExchangeDistributionAliasTextBox.Text, "Alias");
|
||||||
|
var displayName = NormalizeOptionalText(ExchangeDistributionDisplayNameTextBox.Text);
|
||||||
|
var primarySmtp = NormalizeOptionalText(ExchangeDistributionPrimarySmtpTextBox.Text);
|
||||||
|
var result = await Task.Run(() => provider.exchangeManager.CreateDistributionGroupWithOwnershipGroups(
|
||||||
|
name,
|
||||||
|
alias,
|
||||||
|
displayName,
|
||||||
|
primarySmtp));
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
ObjectGuid = result.Item1,
|
||||||
|
Groups = MapSecurityGroupResults(result.Item2)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private async void FetchSecurityGroupsButton_Click(object sender, RoutedEventArgs e)
|
private async void FetchSecurityGroupsButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (_session?.Provider == null)
|
if (_session?.Provider == null)
|
||||||
@@ -412,6 +728,150 @@ namespace LiamWorkflowDiagnostics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task ExecuteProviderActionAsync(string actionName, Func<Task<object>> action)
|
||||||
|
{
|
||||||
|
if (action == null)
|
||||||
|
throw new ArgumentNullException(nameof(action));
|
||||||
|
|
||||||
|
ToggleActionButtons(false);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SaveSettings();
|
||||||
|
AppendLog($"{actionName} gestartet.");
|
||||||
|
var result = await action();
|
||||||
|
ResultTextBox.Text = JsonConvert.SerializeObject(result, Formatting.Indented);
|
||||||
|
AppendLog($"{actionName} erfolgreich abgeschlossen.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
AppendLog($"{actionName} fehlgeschlagen: {ex.Message}", LogLevels.Error);
|
||||||
|
MessageBox.Show(this, ex.ToString(), actionName, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ToggleActionButtons(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private TProvider EnsureInitializedProvider<TProvider>(string providerName) where TProvider : cLiamProviderBase
|
||||||
|
{
|
||||||
|
if (_session?.Provider == null)
|
||||||
|
throw new InvalidOperationException("Bitte zuerst den Provider initialisieren.");
|
||||||
|
|
||||||
|
if (!(_session.Provider is TProvider provider))
|
||||||
|
throw new InvalidOperationException($"Der initialisierte Provider ist nicht vom Typ '{providerName}'. Bitte Einstellungen pruefen und neu initialisieren.");
|
||||||
|
|
||||||
|
return provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<string> ParseIdentifierList(string text, string context)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
|
return new List<string>();
|
||||||
|
|
||||||
|
var trimmed = text.Trim();
|
||||||
|
if (trimmed.StartsWith("[", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var array = JArray.Parse(trimmed);
|
||||||
|
return array.Values<string>()
|
||||||
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||||
|
.Select(i => i.Trim())
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"{context}: JSON-Array konnte nicht gelesen werden. {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return trimmed
|
||||||
|
.Split(new[] { '\r', '\n', ';', ',' }, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.Select(i => i.Trim())
|
||||||
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetRequiredText(string value, string fieldName)
|
||||||
|
{
|
||||||
|
var trimmed = NormalizeOptionalText(value);
|
||||||
|
if (string.IsNullOrWhiteSpace(trimmed))
|
||||||
|
throw new InvalidOperationException($"{fieldName} ist erforderlich.");
|
||||||
|
return trimmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string NormalizeOptionalText(string value)
|
||||||
|
{
|
||||||
|
var trimmed = value?.Trim();
|
||||||
|
return string.IsNullOrWhiteSpace(trimmed) ? null : trimmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int GetSelectedCloneParts()
|
||||||
|
{
|
||||||
|
var parts = cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.None;
|
||||||
|
if (MsTeamsCloneAppsCheckBox.IsChecked ?? false)
|
||||||
|
parts |= cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.Apps;
|
||||||
|
if (MsTeamsCloneTabsCheckBox.IsChecked ?? false)
|
||||||
|
parts |= cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.Tabs;
|
||||||
|
if (MsTeamsCloneSettingsCheckBox.IsChecked ?? false)
|
||||||
|
parts |= cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.Settings;
|
||||||
|
if (MsTeamsCloneChannelsCheckBox.IsChecked ?? false)
|
||||||
|
parts |= cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.Channels;
|
||||||
|
if (MsTeamsCloneMembersCheckBox.IsChecked ?? false)
|
||||||
|
parts |= cMsGraphSharepoint.CloneTeamRequest.ClonableTeamParts.Members;
|
||||||
|
return (int)parts;
|
||||||
|
}
|
||||||
|
|
||||||
|
private object MapResultToken(ResultToken token)
|
||||||
|
{
|
||||||
|
if (token == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Function = token.resultFunction ?? string.Empty,
|
||||||
|
Message = token.resultMessage ?? string.Empty,
|
||||||
|
ErrorId = token.resultErrorId,
|
||||||
|
CreatedGroups = token.createdGroups ?? new List<string>(),
|
||||||
|
ReusedGroups = token.reusedGroups ?? new List<string>(),
|
||||||
|
AddedAclEntries = token.addedAclEntries ?? new List<string>(),
|
||||||
|
SkippedAclEntries = token.skippedAclEntries ?? new List<string>(),
|
||||||
|
EnsuredTraverseGroups = token.ensuredTraverseGroups ?? new List<string>(),
|
||||||
|
Warnings = token.warnings ?? new List<string>()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<object> MapSecurityGroupResults(IEnumerable<Tuple<string, string, string, string>> groups)
|
||||||
|
{
|
||||||
|
return (groups ?? Enumerable.Empty<Tuple<string, string, string, string>>())
|
||||||
|
.Select(i => (object)new
|
||||||
|
{
|
||||||
|
Role = i.Item1 ?? string.Empty,
|
||||||
|
Sid = i.Item2 ?? string.Empty,
|
||||||
|
Name = i.Item3 ?? string.Empty,
|
||||||
|
DistinguishedName = i.Item4 ?? string.Empty
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private object MapMsGraphResult(cMsGraphResultBase result)
|
||||||
|
{
|
||||||
|
if (result == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Id = result.ID,
|
||||||
|
result.DisplayName,
|
||||||
|
result.ODataId,
|
||||||
|
result.Context,
|
||||||
|
Result = result.Result
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private cLiamProviderData ParseProviderDataFromInput(string input)
|
private cLiamProviderData ParseProviderDataFromInput(string input)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(input))
|
if (string.IsNullOrWhiteSpace(input))
|
||||||
@@ -785,6 +1245,7 @@ namespace LiamWorkflowDiagnostics
|
|||||||
? JsonConvert.SerializeObject(data.NamingConventions, Formatting.Indented)
|
? JsonConvert.SerializeObject(data.NamingConventions, Formatting.Indented)
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
||||||
|
UpdateProviderActionPanel();
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -906,6 +1367,41 @@ namespace LiamWorkflowDiagnostics
|
|||||||
public string ServerName { get; set; } = string.Empty;
|
public string ServerName { get; set; } = string.Empty;
|
||||||
public bool UseHttps { get; set; } = false;
|
public bool UseHttps { get; set; } = false;
|
||||||
public string License { get; set; } = string.Empty;
|
public string License { get; set; } = string.Empty;
|
||||||
|
public string NtfsCreateFolderPath { get; set; } = string.Empty;
|
||||||
|
public string NtfsCreateParentPath { get; set; } = string.Empty;
|
||||||
|
public string NtfsCreateOwnerSids { get; set; } = string.Empty;
|
||||||
|
public string NtfsCreateReaderSids { get; set; } = string.Empty;
|
||||||
|
public string NtfsCreateWriterSids { get; set; } = string.Empty;
|
||||||
|
public string NtfsEnsureFolderPath { get; set; } = string.Empty;
|
||||||
|
public string NtfsEnsureOwnerSids { get; set; } = string.Empty;
|
||||||
|
public string NtfsEnsureReaderSids { get; set; } = string.Empty;
|
||||||
|
public string NtfsEnsureWriterSids { get; set; } = string.Empty;
|
||||||
|
public bool NtfsEnsureTraverse { get; set; } = false;
|
||||||
|
public string AdServiceName { get; set; } = string.Empty;
|
||||||
|
public string AdDescription { get; set; } = string.Empty;
|
||||||
|
public int AdScope { get; set; } = (int)eLiamAccessRoleScopes.Universal;
|
||||||
|
public int AdGroupType { get; set; } = (int)ADServiceGroupCreator.ADGroupType.Distribution;
|
||||||
|
public string AdOwnerSids { get; set; } = string.Empty;
|
||||||
|
public string AdMemberSids { get; set; } = string.Empty;
|
||||||
|
public string MsTeamsSourceTeamId { get; set; } = string.Empty;
|
||||||
|
public string MsTeamsNewName { get; set; } = string.Empty;
|
||||||
|
public string MsTeamsDescription { get; set; } = string.Empty;
|
||||||
|
public int MsTeamsVisibility { get; set; } = (int)cMsGraphSharepoint.CloneTeamRequest.TeamVisibilityType.Private;
|
||||||
|
public bool MsTeamsCloneApps { get; set; } = false;
|
||||||
|
public bool MsTeamsCloneTabs { get; set; } = false;
|
||||||
|
public bool MsTeamsCloneSettings { get; set; } = true;
|
||||||
|
public bool MsTeamsCloneChannels { get; set; } = true;
|
||||||
|
public bool MsTeamsCloneMembers { get; set; } = false;
|
||||||
|
public string MsTeamsAdditionalMembers { get; set; } = string.Empty;
|
||||||
|
public string MsTeamsAdditionalOwners { get; set; } = string.Empty;
|
||||||
|
public string ExchangeMailboxName { get; set; } = string.Empty;
|
||||||
|
public string ExchangeMailboxAlias { get; set; } = string.Empty;
|
||||||
|
public string ExchangeMailboxDisplayName { get; set; } = string.Empty;
|
||||||
|
public string ExchangeMailboxPrimarySmtp { get; set; } = string.Empty;
|
||||||
|
public string ExchangeDistributionName { get; set; } = string.Empty;
|
||||||
|
public string ExchangeDistributionAlias { get; set; } = string.Empty;
|
||||||
|
public string ExchangeDistributionDisplayName { get; set; } = string.Empty;
|
||||||
|
public string ExchangeDistributionPrimarySmtp { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user