Skip to content

Commit 6a1ca6b

Browse files
authored
Feature: RDP Admin session (#3216)
* Feature: RDP Admin session * Chore: Upgrade & #3216 * Feature: Use childwindow * Feature: RDP admin session * Docs: #3216
1 parent 0d335b2 commit 6a1ca6b

30 files changed

+529
-407
lines changed

Source/GlobalAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
[assembly: AssemblyTrademark("")]
77
[assembly: AssemblyCulture("")]
88

9-
[assembly: AssemblyVersion("2025.8.11.0")]
10-
[assembly: AssemblyFileVersion("2025.8.11.0")]
9+
[assembly: AssemblyVersion("2025.10.18.0")]
10+
[assembly: AssemblyFileVersion("2025.10.18.0")]

Source/NETworkManager.Localization/Resources/Strings.Designer.cs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3996,4 +3996,7 @@ Right-click for more options.</value>
39963996
<data name="HelpMessage_UseCustomThemes" xml:space="preserve">
39973997
<value>Use custom themes to personalize the appearance of the application. You can edit or add theme in the "Program Folder &gt; Themes" directory. For more details, refer to the documentation.</value>
39983998
</data>
3999+
<data name="AdminConsoleSession" xml:space="preserve">
4000+
<value>Admin (console) session</value>
4001+
</data>
39994002
</root>

Source/NETworkManager.Models/RemoteDesktop/RemoteDesktop.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace NETworkManager.Models.RemoteDesktop;
44

55
public static class RemoteDesktop
66
{
7-
public static List<string> ScreenResolutions => new()
8-
{
7+
public static List<string> ScreenResolutions =>
8+
[
99
"640x480",
1010
"800x600",
1111
"1024x768",
@@ -18,15 +18,15 @@ public static class RemoteDesktop
1818
"1400x1050",
1919
"1680x1050",
2020
"1920x1080"
21-
};
21+
];
2222

23-
public static List<int> ColorDepths => new()
24-
{
23+
public static List<int> ColorDepths =>
24+
[
2525
15,
2626
16,
2727
24,
2828
32
29-
};
29+
];
3030

3131
public static RemoteDesktopKeystrokeInfo GetKeystroke(Keystroke keystroke)
3232
{
@@ -35,8 +35,8 @@ public static RemoteDesktopKeystrokeInfo GetKeystroke(Keystroke keystroke)
3535
switch (keystroke)
3636
{
3737
case Keystroke.CtrlAltDel:
38-
info.ArrayKeyUp = new[] { false, false, false, true, true, true };
39-
info.KeyData = new[] { 0x1d, 0x38, 0x53, 0x53, 0x38, 0x1d };
38+
info.ArrayKeyUp = [false, false, false, true, true, true];
39+
info.KeyData = [0x1d, 0x38, 0x53, 0x53, 0x38, 0x1d];
4040
break;
4141
}
4242

Source/NETworkManager.Models/RemoteDesktop/RemoteDesktopSessionInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class RemoteDesktopSessionInfo
99
public string Username { get; set; }
1010
public string Domain { get; set; }
1111
public SecureString Password { get; set; }
12+
public bool AdminSession { get; set; }
1213
public int Port { get; set; }
1314
public bool AdjustScreenAutomatically { get; set; }
1415
public bool UseCurrentViewSize { get; set; }

Source/NETworkManager.Profiles/GroupInfo.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.Collections.Generic;
2-
using System.Security;
3-
using System.Xml.Serialization;
4-
using NETworkManager.Models.Network;
1+
using NETworkManager.Models.Network;
52
using NETworkManager.Models.PowerShell;
63
using NETworkManager.Models.PuTTY;
74
using NETworkManager.Models.RemoteDesktop;
85
using NETworkManager.Settings;
6+
using System.Collections.Generic;
7+
using System.Security;
8+
using System.Xml.Serialization;
99

1010
namespace NETworkManager.Profiles;
1111

@@ -37,7 +37,7 @@ public GroupInfo(GroupInfo group) : this(group.Name)
3737
{
3838
// General
3939
Description = group.Description;
40-
40+
4141
// Profiles
4242
Profiles = group.Profiles;
4343

@@ -46,6 +46,7 @@ public GroupInfo(GroupInfo group) : this(group.Name)
4646
RemoteDesktop_Username = group.RemoteDesktop_Username;
4747
RemoteDesktop_Domain = group.RemoteDesktop_Domain;
4848
RemoteDesktop_Password = group.RemoteDesktop_Password;
49+
RemoteDesktop_AdminSession = group.RemoteDesktop_AdminSession;
4950
RemoteDesktop_OverrideDisplay = group.RemoteDesktop_OverrideDisplay;
5051
RemoteDesktop_AdjustScreenAutomatically = group.RemoteDesktop_AdjustScreenAutomatically;
5152
RemoteDesktop_UseCurrentViewSize = group.RemoteDesktop_UseCurrentViewSize;
@@ -168,7 +169,7 @@ public GroupInfo(GroupInfo group) : this(group.Name)
168169
/// Name of the group.
169170
/// </summary>
170171
public string Name { get; set; }
171-
172+
172173
/// <summary>
173174
/// Description of the group.
174175
/// </summary>
@@ -183,6 +184,8 @@ public GroupInfo(GroupInfo group) : this(group.Name)
183184
public string RemoteDesktop_Domain { get; set; }
184185

185186
[XmlIgnore] public SecureString RemoteDesktop_Password { get; set; }
187+
188+
public bool RemoteDesktop_AdminSession { get; set; }
186189
public bool RemoteDesktop_OverrideDisplay { get; set; }
187190
public bool RemoteDesktop_AdjustScreenAutomatically { get; set; }
188191

Source/NETworkManager.Profiles/ProfileInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public ProfileInfo(ProfileInfo profile)
8282
RemoteDesktop_Username = profile.RemoteDesktop_Username;
8383
RemoteDesktop_Domain = profile.RemoteDesktop_Domain;
8484
RemoteDesktop_Password = profile.RemoteDesktop_Password;
85+
RemoteDesktop_AdminSession = profile.RemoteDesktop_AdminSession;
8586
RemoteDesktop_OverrideDisplay = profile.RemoteDesktop_OverrideDisplay;
8687
RemoteDesktop_AdjustScreenAutomatically = profile.RemoteDesktop_AdjustScreenAutomatically;
8788
RemoteDesktop_UseCurrentViewSize = profile.RemoteDesktop_UseCurrentViewSize;
@@ -314,6 +315,8 @@ public ProfileInfo(ProfileInfo profile)
314315
public string RemoteDesktop_Domain { get; set; }
315316

316317
[XmlIgnore] public SecureString RemoteDesktop_Password { get; set; }
318+
319+
public bool RemoteDesktop_AdminSession { get; set; }
317320
public bool RemoteDesktop_OverrideDisplay { get; set; }
318321
public bool RemoteDesktop_AdjustScreenAutomatically { get; set; }
319322

Source/NETworkManager/App.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<!-- Styles -->
2727
<ResourceDictionary Source="/Resources/Styles/ButtonStyles.xaml" />
2828
<ResourceDictionary Source="/Resources/Styles/CheckBoxStyles.xaml" />
29+
<ResourceDictionary Source="/Resources/Styles/ChildWindowStyles.xaml" />
2930
<ResourceDictionary Source="/Resources/Styles/ContextMenuStyles.xaml" />
3031
<ResourceDictionary Source="/Resources/Styles/DataGridStyles.xaml" />
3132
<ResourceDictionary Source="/Resources/Styles/DropDownButtonStyles.xaml" />

Source/NETworkManager/Controls/RemoteDesktopControl.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ private void Connect()
212212
RdpClient.AdvancedSettings9.ClearTextPassword = SecureStringHelper.ConvertToString(_sessionInfo.Password);
213213
}
214214

215+
// Admin (console) session
216+
RdpClient.AdvancedSettings9.ConnectToAdministerServer = _sessionInfo.AdminSession;
217+
215218
// Network
216219
RdpClient.AdvancedSettings9.RDPPort = _sessionInfo.Port;
217220

@@ -716,8 +719,4 @@ private void WindowsFormsHost_DpiChanged(object sender, DpiChangedEventArgs e)
716719
AdjustScreen(force: true);
717720
}
718721
#endregion
719-
720-
721-
722-
723722
}

Source/NETworkManager/ProfileDialogManager.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using MahApps.Metro.SimpleChildWindow;
2+
using NETworkManager.Controls;
23
using NETworkManager.Localization.Resources;
34
using NETworkManager.Models;
45
using NETworkManager.Models.Network;
@@ -9,11 +10,9 @@
910
using NETworkManager.Views;
1011
using System;
1112
using System.Collections.Generic;
12-
using System.Diagnostics;
1313
using System.Security;
1414
using System.Threading.Tasks;
1515
using System.Windows;
16-
using NETworkManager.Controls;
1716

1817
namespace NETworkManager;
1918

@@ -23,18 +22,13 @@ public static class ProfileDialogManager
2322

2423
private static ProfileInfo ParseProfileInfo(ProfileViewModel instance)
2524
{
26-
foreach (var tag in instance.TagsCollection)
27-
{
28-
Debug.WriteLine(tag);
29-
}
30-
3125
return new ProfileInfo
3226
{
3327
Name = instance.Name.Trim(),
3428
Host = instance.Host.Trim(),
3529
Description = instance.Description?.Trim(),
3630
Group = instance.Group.Trim(),
37-
TagsCollection = new ObservableSetCollection<string> (instance.TagsCollection),
31+
TagsCollection = new ObservableSetCollection<string>(instance.TagsCollection),
3832

3933
// Network Interface
4034
NetworkInterface_Enabled = instance.NetworkInterface_Enabled,
@@ -97,6 +91,7 @@ private static ProfileInfo ParseProfileInfo(ProfileViewModel instance)
9791
RemoteDesktop_Password = instance.RemoteDesktop_UseCredentials
9892
? instance.RemoteDesktop_Password
9993
: new SecureString(), // Remove sensitive info on disable
94+
RemoteDesktop_AdminSession = instance.RemoteDesktop_AdminSession,
10095
RemoteDesktop_OverrideDisplay = instance.RemoteDesktop_OverrideDisplay,
10196
RemoteDesktop_AdjustScreenAutomatically = instance.RemoteDesktop_AdjustScreenAutomatically,
10297
RemoteDesktop_UseCurrentViewSize = instance.RemoteDesktop_UseCurrentViewSize,
@@ -323,6 +318,7 @@ private static GroupInfo ParseGroupInfo(GroupViewModel instance)
323318
RemoteDesktop_Password = instance.RemoteDesktop_UseCredentials
324319
? instance.RemoteDesktop_Password
325320
: new SecureString(), // Remove sensitive info on disable
321+
RemoteDesktop_AdminSession = instance.RemoteDesktop_AdminSession,
326322
RemoteDesktop_OverrideDisplay = instance.RemoteDesktop_OverrideDisplay,
327323
RemoteDesktop_AdjustScreenAutomatically = instance.RemoteDesktop_AdjustScreenAutomatically,
328324
RemoteDesktop_UseCurrentViewSize = instance.RemoteDesktop_UseCurrentViewSize,

0 commit comments

Comments
 (0)