Certificate/wireless plugins; major refactoring
Migrate much of BI to Services. Added Wireless Profile Provider plugin feature. Added Certificate Authority Provider plugin feature. Modified Certificate Provider plugin feature. Database migration v17, for Device Profiles. Enrolment Client Updated to support CA Certificates, Wireless Profiles and Hardware Info. New Client Enrolment Protocol to support new features. Plugin Manifest Generator added to main solution. Improved AD search performance.
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.DirectoryServices;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Client.Interop
|
||||
{
|
||||
@@ -14,7 +10,7 @@ namespace Disco.Client.Interop
|
||||
public static bool AddLocalGroupMembership(string GroupName, string UserSID, string Username, string UserDomain)
|
||||
{
|
||||
|
||||
using (DirectoryEntry group = new DirectoryEntry(string.Format("WinNT://./{0},group", GroupName)))
|
||||
using (DirectoryEntry group = new DirectoryEntry($"WinNT://./{GroupName},group"))
|
||||
{
|
||||
// Check to see if the User is already a member
|
||||
foreach (object memberRef in (IEnumerable)group.Invoke("Members"))
|
||||
@@ -22,38 +18,15 @@ namespace Disco.Client.Interop
|
||||
using (DirectoryEntry member = new DirectoryEntry(memberRef))
|
||||
{
|
||||
var memberPath = member.Path;
|
||||
if (memberPath.Equals(string.Format("WinNT://{0}/{1}", UserDomain, Username), StringComparison.OrdinalIgnoreCase) ||
|
||||
memberPath.Equals(string.Format("WinNT://{0}", UserSID), StringComparison.OrdinalIgnoreCase))
|
||||
if (memberPath.Equals($"WinNT://{UserDomain}/{Username}", StringComparison.OrdinalIgnoreCase) ||
|
||||
memberPath.Equals($"WinNT://{UserSID}", StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
group.Invoke("Add", string.Format("WinNT://{0}", UserSID));
|
||||
group.Invoke("Add", $"WinNT://{UserSID}");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string CurrentUserDomain
|
||||
{
|
||||
get
|
||||
{
|
||||
return Environment.UserDomainName;
|
||||
}
|
||||
}
|
||||
public static string CurrentUserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return Environment.UserName;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ComputerName
|
||||
{
|
||||
get
|
||||
{
|
||||
return Environment.MachineName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user