This commit is contained in:
Florian Späth
2025-01-31 01:49:31 +01:00
commit afb2f418fc
56 changed files with 2822 additions and 0 deletions

61
GUIS/cleartmp.ps1 Normal file
View File

@@ -0,0 +1,61 @@
function Load_clrtmp {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Name="Window" Title="Cleaner - Information" Height="440" Width="624" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Grid Background="#00344E">
<TextBlock Name="text" Text="" HorizontalAlignment="Left" Margin="34,44,0,0" TextWrapping="Wrap" Foreground="White" Width="554" TextAlignment="Center" Height="360" VerticalAlignment="Top" FontSize="16"></TextBlock>
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="264,390,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Information" HorizontalAlignment="Left" VerticalAlignment="Top" Width="624" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$text = $window.FindName("text")
$Script:infook = $window.findName("btnok")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
$text.Text = "Der Speicherbedarf auf Gruppenlaufwerken, insbesondere aber auf persönlichen Home-Laufwerken steigt stetig. Daher muss jährlich ein hoher Betrag in die Erweiterung und die Erneuerung von Speichersystemen investiert werden.
Gleichzeitig soll im BR die Zusammenarbeit durch das Teilen von Informationen, Dokumenten und Content verbessert werden. Persönliche und damit exklusive Inhalte und Daten sind dabei kontraproduktiv. Dies gilt vor allem für den produzierten Mediencontent.
Mit diesem Werkzeug können Sie den zu löschenden oder zu verschiebenden Inhalt leichter identifizieren. `n`n$Script:Version `nCopyright Bayerischer Rundfunk (2022)`nAutor: Florian Späth `nDSGVO-konform"
return $window
}
$Script:info = Load_info $args[0] # Variable: $info
$info.Add_MouseLeftButtonDown({
$info.DragMove()
})
$infook.Add_Click({
$info.Hide()
})

97
GUIS/confirm.ps1 Normal file
View File

@@ -0,0 +1,97 @@
function Load_confirm {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Title="HDS Admin Panel - Confirm" Height="276" Width="509" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Grid Background="#00344E">
<Button Name="btnstop" Content="BACK" HorizontalAlignment="Left" Margin="122,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkGreen" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Confirm" HorizontalAlignment="Left" VerticalAlignment="Top" Width="509" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
<Label Name="choosen3" Content="Confirm the action and press the button again" HorizontalAlignment="Center" Margin="0,42,0,0" VerticalAlignment="Top" Width="270" Height="34" FontSize="12" FontWeight="Bold" Foreground="White"/>
<TextBox Name="text" Text="TEXT" BorderThickness="0" HorizontalAlignment="Center" Height="113" TextWrapping="Wrap" VerticalAlignment="Center" Width="412" Background="#013C5A" HorizontalContentAlignment="Center" Foreground="White" FontSize="14" IsTabStop="False"/>
<Button Name="btngo" Content="GO!" HorizontalAlignment="Left" Margin="286,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkRed" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$Script:confirmtext = $window.FindName("text")
$Script:confirmok = $window.findName("btngo")
$Script:confirmstop = $window.findName("btnstop")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
return $window
}
function confirm {
param (
[String]$text
)
Write-Admin-Log "Confirm funkction triggered"
if ($null -ne $text) {
$Script:Confirmtext.text = $text
$confirm.ShowDialog() | Out-Null
if ($Script:GO) {
return $true
}
}
}
$Script:confirm = Load_confirm $args[0] # Variable: $confirm
$confirmok.Add_Click({
Write-Admin-Log "Confirm success"
$Script:GO = $true
$confirm.Hide()
})
$confirm.Add_MouseLeftButtonDown({
$confirm.DragMove()
})
$confirmstop.Add_Click({
Write-Admin-Log "Confirm denial"
$Script:GO = $false
$confirm.Hide()
})

97
GUIS/gaming.ps1 Normal file
View File

@@ -0,0 +1,97 @@
function Load_gaming {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Title="HDS Admin Panel - gaming Script" Height="171" Width="237" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Grid Background="#00344E">
<Button Name="btnok" Content="Close" HorizontalAlignment="Center" Margin="0,120,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Gaming" HorizontalAlignment="Left" VerticalAlignment="Top" Width="240" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
<Label x:Name="l2" Content="MEG" HorizontalAlignment="Left" Margin="45,47,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
<Button TabIndex="4" x:Name="btnmeg" Content="Touch" ToolTip="aps the PowerButton of MEG" BorderThickness="0" HorizontalAlignment="Left" Margin="12,76,0,0" VerticalAlignment="Top" Width="102" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Label x:Name="l2_Kopieren" Content="ITM" HorizontalAlignment="Left" Margin="157,45,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
<Button TabIndex="4" x:Name="btnitm" Content="Touch" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="124,76,0,0" VerticalAlignment="Top" Width="102" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$Script:gaming_btn_meg = $window.FindName("btnmeg")
$Script:gaming_btn_itm = $window.findName("btnitm")
$Script:gaming_ok = $window.findName("btnok")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
return $window
}
$Script:gaming = Load_gaming $args[0] # Variable: $gaming
$gaming.Add_MouseLeftButtonDown({
$gaming.DragMove()
})
$gaming_btn_itm.Add_Click({
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
$servername = '192.168.178.4'
$username = 'spaethf'
Write-Admin-Log "BTN ITM pressed"
if (confirm "Bei dem Server gaming Server ITM wird eine Power Aktion ausgeführt") {
$command = 'python tap_itm.py'
#Execute SSH command
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
}
})
$gaming_btn_meg.Add_Click({
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
$servername = '192.168.178.4'
$username = 'spaethf'
Write-Admin-Log "BTN MEG pressed"
if (confirm "Bei dem Server gaming Server MEG wird eine Power Aktion ausgeführt") {
$command = 'python tap_meg.py'
#Execute SSH command
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
}
})
$gaming_ok.Add_Click({
$gaming.Hide()
})

140
GUIS/getlogs.ps1 Normal file
View File

@@ -0,0 +1,140 @@
function Load_getlogs {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Name="Window" Title="Cleaner - Information" Height="348" Width="406" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None" Topmost="true">
<Grid Background="#00344E">
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="165,294,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Außer Betrieb" HorizontalAlignment="Center" VerticalAlignment="Top" Width="406" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
<Button x:Name="btn_cert" Content="Certificate" HorizontalAlignment="Left" Margin="33,53,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button x:Name="btn_zeroconfig" Content="ZeroConfig" HorizontalAlignment="Left" Margin="33,100,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button x:Name="btn_zeroconfigcert" Content="ZeroConfig&#xD;&#xA;Certtificate" HorizontalAlignment="Left" Margin="33,147,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button x:Name="btn_defudbu" Content="DEFU DB&#xD;&#xA; Update" HorizontalAlignment="Left" Margin="33,194,0,0" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$Script:getlog_btn_cert = $window.findName("btn_cert")
$Script:getlog_btn_zeroconfig = $window.findName("btn_zeroconfig")
$Script:getlog_btn_zeroconfigcert = $window.findName("btn_zeroconfigcert")
$Script:getlog_btn_defudbu = $window.findName("btn_defudbu")
$Script:getlog_btn_ok = $window.findName("btnok")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
return $window
}
$Script:getlog = Load_getlogs $args[0] # Variable: $getlog
$getlog.Add_MouseLeftButtonDown({
$getlog.DragMove()
})
$getlog_btn_cert.Add_Click({
ii $Script:cert_path
})
$getlog_btn_zeroconfig.Add_Click({
ii $Script:zero_config_path
})
$getlog_btn_zeroconfigcert.Add_Click({
ii $zero_config_path\Certs\update-idrac-cert
})
$getlog_btn_defudbu.Add_Click({
ii $defudbu_path\ProcessUpdatableDevices\LogFiles
})
$getlog_btn_ok.Add_Click({
$getlog.Hide()
})

61
GUIS/info.ps1 Normal file
View File

@@ -0,0 +1,61 @@
function Load_info {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Name="Window" Title="Cleaner - Information" Height="440" Width="624" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Grid Background="#00344E">
<TextBlock Name="text" Text="" HorizontalAlignment="Left" Margin="34,44,0,0" TextWrapping="Wrap" Foreground="White" Width="554" TextAlignment="Center" Height="360" VerticalAlignment="Top" FontSize="16"></TextBlock>
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="264,390,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Information" HorizontalAlignment="Left" VerticalAlignment="Top" Width="624" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$text = $window.FindName("text")
$Script:infook = $window.findName("btnok")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
$text.Text = "Das Admin Panel wurde geschaffen um Skripte welche von dem einzig waren Florian Spaeth entwickelt wurden in einer grafischen Oberfläche zu steuern.
Die Anwendung wurde so entworfen das diese maximale Wartungsfreundlichkeit bietet und auch Usern mit wenig Powershell Erfahrung die Möglichkeit gibt, neue Fenster hinzu zu fügen.
Im GitLab unter `"AllgemeineSkripte/examples`" kann Beispiel Code entnommen werden, wenn man sind in den BR hacken kann (: `n`nBugs in der GUI werden nicht aktiv verfolgt!`n`n$Script:Version `nCopyright bei Leiter (2024)`nAutor: Florian Spaeth `nDSGVO-Konform"
return $window
}
$Script:info = Load_info $args[0] # Variable: $info
$info.Add_MouseLeftButtonDown({
$info.DragMove()
})
$infook.Add_Click({
$info.Hide()
})

266
GUIS/main.ps1 Normal file
View File

@@ -0,0 +1,266 @@
function Load_main {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Title="HDS Admin Panel - Hauptfenster" Height="454" Width="1020" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Window.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#0082c6"/>
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="#022335"/>
</Window.Resources>
<Grid Background="#00344E">
<Image Name="Laufwerk" HorizontalAlignment="Left" Height="104" Margin="0,359,0,0" VerticalAlignment="Top" Width="110" Source="Binding" RenderTransformOrigin="0.409,0.857"/>
<Label Name="version" Content="HDS Admin Panel" HorizontalAlignment="Left" Margin="87,379,0,0" VerticalAlignment="Top" Height="36" Width="186" FontSize="16" Foreground="White"/>
<TextBox Name="tblaufwerkauslastung" BorderThickness="0" HorizontalAlignment="Left" Height="22" Margin="87,411,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="263" Background="#013C5A" Foreground="White" IsReadOnly="True" FontSize="14" IsTabStop="False"/>
<Label Content="Log Admin Panel" HorizontalAlignment="Left" Margin="750,64,0,0" VerticalAlignment="Top" Height="369" Width="254" Background="#013C5A" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
<Button TabIndex="4" Name="btnrefresh" Content="Clear Log" BorderThickness="0" HorizontalAlignment="Left" Margin="759,95,0,0" VerticalAlignment="Top" Width="237" Height="36" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" Name="btnScanner" Content="Very dark void" BorderThickness="0" HorizontalAlignment="Left" Margin="26,17,0,0" VerticalAlignment="Top" Width="218" Height="42" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Label Content="Administartion tool for the managing and manual handling of scripts created by Florian Spaeth.&#xA;It just needs to run! Nothing more or less. You understand me?!?. " HorizontalAlignment="Left" Margin="249,12,0,0" VerticalAlignment="Top" Width="755" Height="52" FontSize="15" Foreground="White"/>
<Label Name="log" Content="" HorizontalAlignment="Left" Margin="759,138,0,0" VerticalAlignment="Top" Width="237" Height="284" FontSize="12" Foreground="White"/>
<Button TabIndex="1" Name="btninfo" HorizontalAlignment="Left" Margin="971,22,0,0" VerticalAlignment="Top" Width="30" Height="30" Background="Transparent" ToolTip="Information" BorderThickness="0">
<Image Name="imginfo" Source="{Binding}"/>
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnMEG" Content="Gaming" BorderThickness="0" HorizontalAlignment="Left" Margin="28,85,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnr710" Content="R710" BorderThickness="0" HorizontalAlignment="Left" Margin="172,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnITM" Content="ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="320,85,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White" HorizontalContentAlignment="Center">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren3" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren4" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren5" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,159,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren6" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren7" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,159,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren8" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren9" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren10" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,231,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren11" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren12" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,231,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren13" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren14" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren15" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,307,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren16" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnScanner_Kopieren17" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,307,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btngetlogs" Content="Get Logs" BorderThickness="0" HorizontalAlignment="Left" Margin="464,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="0" x:Name="btnclrtmp" Content="Clear tmp" BorderThickness="0" HorizontalAlignment="Left" Margin="610,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Label Content="" HorizontalAlignment="Left" Margin="1017,0,0,0" VerticalAlignment="Center" Height="454" Width="3" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
<Label Content="" HorizontalAlignment="Left" VerticalAlignment="Center" Height="454" Width="3" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
<Label Content="" HorizontalAlignment="Center" VerticalAlignment="Top" Height="3" Width="1020" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center" Margin="0,451,0,0"/>
<Label Content="" HorizontalAlignment="Center" VerticalAlignment="Top" Height="3" Width="1020" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
</Grid>
</Window>
"@
# Lädt das Fenster
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$Laufwerk = $window.findName("Laufwerk")
$Script:mainimgswitch = $window.findName("imgswitch")
$imginfo = $window.findName("imginfo")
$Script:bar = $window.findName("pbbar")
$Script:last = $window.findName("tblaufwerkauslastung")
$Script:mainscanner = $window.findName("btnScanner")
$Script:maininfo = $window.findName("btninfo")
$Script:mainloading = $window.findName("pbLoading")
$Script:btn_logchange = $window.findName("btnfiltersw")
$Script:btn_MEG = $window.findName("btnMEG")
$Script:btn_itm = $window.findName("btnITM")
$Script:btn_r710 = $window.findName("btnr710")
$Script:btn_getlogs = $window.findName("btngetlogs")
$Script:btn_logrefresh = $window.findName("btnrefresh")
$Script:main_log = $window.findname("log")
$Script:main_version = $window.findname("version")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
$Laufwerk.Source = "$root/Source/HDD1.png"
$imginfo.Source = "$root/Source/info.png"
$last.Text = "Current User: $Env:UserName"
$main_version.Content = "$Script:Version"
$btn_MEG.ToolTip = "Zero configuration Tool for DELL iDrac`nAccount _autcert needed"
$btn_ITM.ToolTip = "Certificate distributor for DELL iDrac`nAccount _hardcon needed"
$btn_R710.ToolTip = "Collection of Tools for DEFU Database`nAccount _DellFirmwareUpdates needed"
$btn_getlogs.ToolTip = "Collection of all Logs known to this Script"
return $window
}
$Script:main = Load_main $args[0] # Variable: $main
$btn_logrefresh.Add_Click({
$main_log.content = ""
Write-Admin-Log "Clear GUI Log"
})
$mainscanner.Add_Click({
$main.Hide()
Write-Admin-Log "Seik"
})
$btn_ITM.Add_Click({
Write-Admin-Log "open cert windows"
})
$btn_MEG.Add_Click({
Write-Admin-Log "open Gaming window"
$gaming.ShowDialog() | Out-Null
})
$btn_R710.Add_Click({
Write-Admin-Log "open R710 window"
$r710.ShowDialog() | Out-Null
})
$btn_getlogs.Add_Click({
Write-Admin-Log "open get logs window"
$getlog.ShowDialog() | Out-Null
})
$maininfo.Add_Click({
$info.ShowDialog() | Out-Null
})
$main.Add_MouseLeftButtonDown({
$main.DragMove()
})

133
GUIS/r710.ps1 Normal file
View File

@@ -0,0 +1,133 @@
function Load_r710 {
param ($root)
[XML]$Form = @"
<?xaml encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Title="HDS Admin Panel - gaming Script" Height="404" Width="510" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
<Grid Background="#00344E">
<Button Name="btnok" Content="Close" HorizontalAlignment="Left" Margin="11,358,0,0" VerticalAlignment="Top" Width="111" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="R710" HorizontalAlignment="Center" VerticalAlignment="Top" Width="377" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold" Margin="0,5,0,0"/>
<Label x:Name="l2" Content="Power Status:" HorizontalAlignment="Left" Margin="11,148,0,0" VerticalAlignment="Top" Width="95" Height="26" FontSize="12" Foreground="White"/>
<Button TabIndex="4" x:Name="btnstart" Content="Start" ToolTip="aps the PowerButton of MEG" BorderThickness="0" HorizontalAlignment="Left" Margin="11,55,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Label x:Name="l2_Kopieren" Content="" HorizontalAlignment="Left" Margin="150,50,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
<Button TabIndex="4" x:Name="btnstop" Content="Stop" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="11,86,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<Button TabIndex="4" x:Name="btninspect" Content="Inspect" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="11,117,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
</Button>
<TextBox Name="log" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="340" Margin="133,54,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="369" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
<Label x:Name="l2_Kopieren1" Content="FQDN:" HorizontalAlignment="Left" Margin="10,224,0,0" VerticalAlignment="Top" Width="73" Height="26" FontSize="12" Foreground="White"/>
<Label x:Name="l2_Kopieren2" Content="BIOS Version:" HorizontalAlignment="Left" Margin="10,184,0,0" VerticalAlignment="Top" Width="84" Height="26" FontSize="12" Foreground="White"/>
<TextBox x:Name="log_Power" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="11,170,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="111" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
<TextBox x:Name="log_BIOS" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="11,208,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="111" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
<TextBox x:Name="log_MAC" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="10,248,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="112" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
</Grid>
</Window>
"@
# Lädt das Fenster
$NR=(New-Object System.Xml.XmlNodeReader $Form)
$window=[Windows.Markup.XamlReader]::Load($NR)
# Objekt - Variablen Verknüpfung
$Script:r710_btn_start = $window.FindName("btnstart")
$Script:r710_btn_stop = $window.FindName("btnstop")
$Script:r710_btn_inspect = $window.FindName("btninspect")
$Script:r710ok = $window.findName("btnok")
$Env:r710_log_power = $window.findName("log_Power")
$Env:r710_log_bios = $window.findName("log_BIOS")
$Env:r710_log_mac = $window.findName("log_MAC")
$Script:r710_log = $window.findName("log")
# Verknüpft feste Elemente
$window.Title = $Script:Version
$window.icon="$root/Source/Logo.png"
return $window
}
$Script:r710 = Load_r710 $args[0] # Variable: $r710
#$Script:Timestamp = get-date -format "yyyy-MM-dd HH:mm:ss"
$r710.Add_MouseLeftButtonDown({
$r710.DragMove()
})
$r710_btn_start.Add_Click({
Write-Admin-Log "BTN r710 start pressed"
if (confirm "Server R710 wird durch erneute betätigung gestartet") {
cd $racpath
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerup)
}
})
$r710_btn_stop.Add_Click({
Write-Admin-Log "BTN r710 stop pressed"
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nSind alle Virtuelle Maschinen ausgeschaltet?") {
cd $Script:racpath
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerdown)
}
})
$r710_btn_inspect.Add_Click({
Write-Admin-Log "BTN r710 inspect pressed"
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nSind alle Virtuelle Maschinen ausgeschaltet?") {
cd $Script:racpath
$collection = $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" getsysinfo)
foreach ($item in $collection) {
if ($null -ne $item) {
$r710_log.Text += "$item`n"
if($item -match "DNS RAC Name"){
$index = ($item.IndexOf("="))
$Script:r710_log_mac.Text = $item.Substring($index+1)
}
if($item -match "Firmware Version"){
$index = ($item.IndexOf("="))
$Script:r710_log_bios.Text = $item.Substring($index+1)
}
if($item -match "Power Status"){
$index = ($item.IndexOf("="))
$Script:r710_log_power.Text = $item.Substring($index+1)
}
}
}
}
})
$r710ok.Add_Click({
$r710.Hide()
})