diff --git a/ClientFaux.sln b/ClientFaux.sln index 930f24d..a443994 100644 --- a/ClientFaux.sln +++ b/ClientFaux.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30002.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientFaux", "ClientFaux\ClientFaux.csproj", "{A38F19D6-53D1-45B2-A40A-27CE08A1927E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientFaux", "src\ClientFaux\ClientFaux.csproj", "{A38F19D6-53D1-45B2-A40A-27CE08A1927E}" EndProject Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Installer", "Installer\Installer.vdproj", "{BBBE2700-83DA-4E8B-8C00-2565DA44BF8A}" EndProject diff --git a/Images/docs_01_fcmsettings.png b/Images/docs_01_fcmsettings.png new file mode 100644 index 0000000..87a8a2e Binary files /dev/null and b/Images/docs_01_fcmsettings.png differ diff --git a/Images/docs_02_settings02.png b/Images/docs_02_settings02.png new file mode 100644 index 0000000..1950b93 Binary files /dev/null and b/Images/docs_02_settings02.png differ diff --git a/fox.rtf b/Installer/fox.rtf similarity index 100% rename from fox.rtf rename to Installer/fox.rtf diff --git a/ClientFaux/Images/foxdeploy.ico b/Installer/foxdeploy.ico similarity index 100% rename from ClientFaux/Images/foxdeploy.ico rename to Installer/foxdeploy.ico diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..e84832f --- /dev/null +++ b/docs/README.md @@ -0,0 +1,33 @@ +![ClientFaux logo, think 'sly like a fox'](https://github.com/1RedOne/ClientFaux/raw/master/ClientFaux/Images/ClientFaux3.0.png) + +### Instructions + +**Requires HTTP Mode enabled on Primary** +*Working on allowing https mode, but presently only expected to work with a primary which allows http communications* + +Navigate to the `⚙CM Settings' tab and provide your CM Servers FQDN or netbios name, then the three letter site code. The tool **will not** work without both. + +![Filling in Site Info](https://github.com/1RedOne/ClientFaux/raw/master/ClientFaux/Images/docs_01_fcmsettings.png) + +Then switch to the **Naming** tab and provide your client base name and the starting and ending device IDs you'd like to create in CM. + +![Filling in Device Info](https://github.com/1RedOne/ClientFaux/raw/master/ClientFaux/Images/docs_02_settings02.png) + +Then hit 'Ready' from the main tab when you're ready to go! + +*These settings are now saved between launches of the application!* + +The client should appear within CM in ten seconds or so! Hardware Inventory will take a bit longer to appear. + +### Providing Custom Inventory + +//todo... + + +### Reconciliation and Reporting + +All devices created with ClientFaux recieve the custom DDR property of `ClientType : FakeClient`, you can use this property to exclude all fake Clients, or to exclude them instead in your reports and Collections. + +### Troubleshooting + +Check `DDM.Log` and `mpcontrol.log` on the ConfigMgr primary site for troubleshooting information and also the `\SMS_CCM\Logs\MP_RegistrationManager.log` file for additional troubleshooting. Now also creates client side logging as well, which will be found in the working directory of the app, as `DebugCMLog.log` \ No newline at end of file diff --git a/ClientFaux/App.config b/src/ClientFaux/App.config similarity index 100% rename from ClientFaux/App.config rename to src/ClientFaux/App.config diff --git a/ClientFaux/App.xaml b/src/ClientFaux/App.xaml similarity index 100% rename from ClientFaux/App.xaml rename to src/ClientFaux/App.xaml diff --git a/ClientFaux/App.xaml.cs b/src/ClientFaux/App.xaml.cs similarity index 100% rename from ClientFaux/App.xaml.cs rename to src/ClientFaux/App.xaml.cs diff --git a/ClientFaux/ClientFaux.csproj b/src/ClientFaux/ClientFaux.csproj similarity index 95% rename from ClientFaux/ClientFaux.csproj rename to src/ClientFaux/ClientFaux.csproj index 735dd06..e454e50 100644 --- a/ClientFaux/ClientFaux.csproj +++ b/src/ClientFaux/ClientFaux.csproj @@ -100,8 +100,11 @@ MSBuild:Compile Designer - - + + + + + MSBuild:Compile Designer @@ -110,7 +113,7 @@ App.xaml Code - + MainWindow.xaml Code @@ -140,6 +143,7 @@ Always + Always diff --git a/ClientFaux/Images/ClientFaux3.0.png b/src/ClientFaux/Images/ClientFaux3.0.png similarity index 100% rename from ClientFaux/Images/ClientFaux3.0.png rename to src/ClientFaux/Images/ClientFaux3.0.png diff --git a/ClientFaux/Images/FoxDeploy Client Faux Bannerv3.jpg b/src/ClientFaux/Images/FoxDeploy Client Faux Bannerv3.jpg similarity index 100% rename from ClientFaux/Images/FoxDeploy Client Faux Bannerv3.jpg rename to src/ClientFaux/Images/FoxDeploy Client Faux Bannerv3.jpg diff --git a/ClientFaux/Images/Foxdeploy_DEPLOY_large1102350.png b/src/ClientFaux/Images/Foxdeploy_DEPLOY_large1102350.png similarity index 100% rename from ClientFaux/Images/Foxdeploy_DEPLOY_large1102350.png rename to src/ClientFaux/Images/Foxdeploy_DEPLOY_large1102350.png diff --git a/foxdeploy.ico b/src/ClientFaux/Images/foxdeploy.ico similarity index 100% rename from foxdeploy.ico rename to src/ClientFaux/Images/foxdeploy.ico diff --git a/ClientFaux/Images/step01.png b/src/ClientFaux/Images/step01.png similarity index 100% rename from ClientFaux/Images/step01.png rename to src/ClientFaux/Images/step01.png diff --git a/ClientFaux/Images/step02.png b/src/ClientFaux/Images/step02.png similarity index 100% rename from ClientFaux/Images/step02.png rename to src/ClientFaux/Images/step02.png diff --git a/ClientFaux/Images/step03.png b/src/ClientFaux/Images/step03.png similarity index 100% rename from ClientFaux/Images/step03.png rename to src/ClientFaux/Images/step03.png diff --git a/ClientFaux/MainWindow.xaml b/src/ClientFaux/MainWindow.xaml similarity index 100% rename from ClientFaux/MainWindow.xaml rename to src/ClientFaux/MainWindow.xaml diff --git a/ClientFaux/MainWindow.xaml.cs b/src/ClientFaux/MainWindow.xaml.cs similarity index 99% rename from ClientFaux/MainWindow.xaml.cs rename to src/ClientFaux/MainWindow.xaml.cs index e8a1edb..124bb0a 100644 --- a/ClientFaux/MainWindow.xaml.cs +++ b/src/ClientFaux/MainWindow.xaml.cs @@ -8,6 +8,7 @@ using System.IO; using System.ComponentModel; using static CMFaux.CMFauxStatusViewClasses; +using static CMFaux.Models; using System.Collections.ObjectModel; using Microsoft.ConfigurationManagement.Messaging.Framework; using System.Collections.Generic; @@ -17,10 +18,10 @@ using System.Threading.Tasks; using log4net; using System.Reflection; +using static ClientFaux.Models.Models; namespace CMFaux { - // to do : fix discovery public partial class MainWindow : Window, INotifyPropertyChanged { private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); diff --git a/src/ClientFaux/Models/.editorconfig b/src/ClientFaux/Models/.editorconfig new file mode 100644 index 0000000..d5e41e4 --- /dev/null +++ b/src/ClientFaux/Models/.editorconfig @@ -0,0 +1,5 @@ +# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\git\ClientFaux\src\ClientFaux\Models\ codebase based on best match to current usage at 10/9/2020 +# You can modify the rules from these initially generated values to suit your own policies +# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +[*.cs] + diff --git a/ClientFaux/AppSettings.cs b/src/ClientFaux/Models/AppSettings.cs similarity index 100% rename from ClientFaux/AppSettings.cs rename to src/ClientFaux/Models/AppSettings.cs diff --git a/src/ClientFaux/Models/CustomClientRecord.cs b/src/ClientFaux/Models/CustomClientRecord.cs new file mode 100644 index 0000000..1170c6a --- /dev/null +++ b/src/ClientFaux/Models/CustomClientRecord.cs @@ -0,0 +1,11 @@ +namespace CMFaux +{ + public partial class Models + { + public class CustomClientRecord + { + public string RecordName { get; set; } + public string RecordValue { get; set; } + } + } +} \ No newline at end of file diff --git a/src/ClientFaux/Models/Device.cs b/src/ClientFaux/Models/Device.cs new file mode 100644 index 0000000..4cb8897 --- /dev/null +++ b/src/ClientFaux/Models/Device.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ClientFaux.Models +{ + public partial class Models + { + public class Device : INotifyPropertyChanged + { + private string s; + private string i; + private int p; + public string Name { get; set; } + + public string Status + { + get { return s; } + set + { + s = value; + // Call OnPropertyChanged whenever the property is updated + OnPropertyChanged("Status"); + } + } + + public string ImageSource + { + get { return i; } + set + { + i = value; + // Call OnPropertyChanged whenever the property is updated + OnPropertyChanged("ImageSource"); + } + } + + public int ProcessProgress + { + get { return p; } + set + { + p = value; + // Call OnPropertyChanged whenever the property is updated + OnPropertyChanged("ProcessProgress"); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged(string name) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(name)); + } + } + } + } +} \ No newline at end of file diff --git a/ClientFaux/FauxDeployCMAgent.cs b/src/ClientFaux/Models/FauxDeployCMAgent.cs similarity index 99% rename from ClientFaux/FauxDeployCMAgent.cs rename to src/ClientFaux/Models/FauxDeployCMAgent.cs index 9419a1c..28f7ba0 100644 --- a/ClientFaux/FauxDeployCMAgent.cs +++ b/src/ClientFaux/Models/FauxDeployCMAgent.cs @@ -1,19 +1,23 @@ -using Microsoft.ConfigurationManagement.Messaging.Framework; +using static CMFaux.Models; +using static CMFaux.CMFauxStatusViewClasses; + +using Microsoft.ConfigurationManagement.Messaging.Framework; using Microsoft.ConfigurationManagement.Messaging.Messages; +using Microsoft.ConfigurationManagement.Messaging.Messages.Server; using Microsoft.ConfigurationManagement.Messaging.Sender.Http; + using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Diagnostics; -using static CMFaux.CMFauxStatusViewClasses; -using Microsoft.ConfigurationManagement.Messaging.Messages.Server; + using System.IO; -using CERTENROLLLib; using System.Collections.ObjectModel; using System.Management; using System.Security; using System.Xml; +using CERTENROLLLib; using log4net; namespace CMFaux diff --git a/src/ClientFaux/Models/StatusEnum.cs b/src/ClientFaux/Models/StatusEnum.cs new file mode 100644 index 0000000..873f98f --- /dev/null +++ b/src/ClientFaux/Models/StatusEnum.cs @@ -0,0 +1,16 @@ +namespace ClientFaux.Models +{ + using System.ComponentModel; + + public enum StatusEnum + { + [Description("Creating Certificate")] + CreateCert = 1, + + [Description("Registering Client")] + RegisteringClient = 2, + + [Description("Sending Discovery")] + SendingDiscovery = 3 + } +} \ No newline at end of file diff --git a/ClientFaux/StatusViewClasses.cs b/src/ClientFaux/Models/StatusViewClasses.cs similarity index 57% rename from ClientFaux/StatusViewClasses.cs rename to src/ClientFaux/Models/StatusViewClasses.cs index fc35cbe..8488a20 100644 --- a/ClientFaux/StatusViewClasses.cs +++ b/src/ClientFaux/Models/StatusViewClasses.cs @@ -13,7 +13,7 @@ namespace CMFaux { - public class CMFauxStatusViewClasses + public partial class CMFauxStatusViewClasses { public static List GetWMIClasses() { @@ -25,98 +25,31 @@ public static List GetWMIClasses() /*"Win32_LogicalDisk",*//*"Win32_Processor",*//*"Win32_SystemDevices",*//*"Win32_Product","Win32_PnpEntity"*/ }; } + public static string GetOSRealVersionInfo() - { + { FileVersionInfo fvi = FileVersionInfo.GetVersionInfo( Path.Combine( System.Environment.GetFolderPath(System.Environment.SpecialFolder.System), "kernel32.dll")); return fvi.ProductVersion; } - - public class CustomClientRecord - { - public string RecordName { get; set; } - public string RecordValue { get; set; } - } - - public enum Statuses - { - [Description("Creating Certificate")] - CreateCert = 1, - [Description("Registering Client")] - RegisteringClient = 2, - [Description("Sending Discovery")] - SendingDiscovery = 3 - } public event PropertyChangedEventHandler PropertyChanged; + public void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } - public class Device : INotifyPropertyChanged - { - private string s; - private string i; - private int p; - public string Name { get; set; } - - public string Status { - get { return s; } - set - { - s = value; - // Call OnPropertyChanged whenever the property is updated - OnPropertyChanged("Status"); - } - - } - public string ImageSource - { - get { return i; } - set - { - i = value; - // Call OnPropertyChanged whenever the property is updated - OnPropertyChanged("ImageSource"); - } - - } - - public int ProcessProgress - { - get { return p; } - set - { - p = value; - // Call OnPropertyChanged whenever the property is updated - OnPropertyChanged("ProcessProgress"); - } - } - - public event PropertyChangedEventHandler PropertyChanged; - protected void OnPropertyChanged(string name) - { - PropertyChangedEventHandler handler = PropertyChanged; - if (handler != null) - { - handler(this, new PropertyChangedEventArgs(name)); - } - } - } - // used to rewrite the OS property reported to CM [XmlRoot("CCM_DiscoveryData")] // Must define an XmlRoot that represents the class name public sealed class CMFauxStatusViewClassesFixedOSRecord : InventoryInstanceElement - { - - + { [XmlElement] public string PlatformId { get; set; } - + protected override void DiscoverSelf() { base.DiscoverSelf(); @@ -131,7 +64,4 @@ public CMFauxStatusViewClassesFixedOSRecord() } } } - - - -} +} \ No newline at end of file diff --git a/ClientFaux/Properties/AssemblyInfo.cs b/src/ClientFaux/Properties/AssemblyInfo.cs similarity index 100% rename from ClientFaux/Properties/AssemblyInfo.cs rename to src/ClientFaux/Properties/AssemblyInfo.cs diff --git a/ClientFaux/Properties/LICENSE b/src/ClientFaux/Properties/LICENSE similarity index 100% rename from ClientFaux/Properties/LICENSE rename to src/ClientFaux/Properties/LICENSE diff --git a/ClientFaux/Properties/Resources.Designer.cs b/src/ClientFaux/Properties/Resources.Designer.cs similarity index 100% rename from ClientFaux/Properties/Resources.Designer.cs rename to src/ClientFaux/Properties/Resources.Designer.cs diff --git a/ClientFaux/Properties/Resources.resx b/src/ClientFaux/Properties/Resources.resx similarity index 100% rename from ClientFaux/Properties/Resources.resx rename to src/ClientFaux/Properties/Resources.resx diff --git a/ClientFaux/Properties/Settings.Designer.cs b/src/ClientFaux/Properties/Settings.Designer.cs similarity index 100% rename from ClientFaux/Properties/Settings.Designer.cs rename to src/ClientFaux/Properties/Settings.Designer.cs diff --git a/ClientFaux/Properties/Settings.settings b/src/ClientFaux/Properties/Settings.settings similarity index 100% rename from ClientFaux/Properties/Settings.settings rename to src/ClientFaux/Properties/Settings.settings diff --git a/ClientFaux/Properties/settings.json b/src/ClientFaux/Properties/settings.json similarity index 100% rename from ClientFaux/Properties/settings.json rename to src/ClientFaux/Properties/settings.json diff --git a/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.dll b/src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.dll similarity index 100% rename from ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.dll rename to src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.dll diff --git a/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.xml b/src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.xml similarity index 100% rename from ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.xml rename to src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Messaging.xml diff --git a/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.dll b/src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.dll similarity index 100% rename from ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.dll rename to src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.dll diff --git a/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.xml b/src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.xml similarity index 100% rename from ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.xml rename to src/ClientFaux/Ref/Microsoft.ConfigurationManagement.Security.Cryptography.xml diff --git a/ClientFaux/Ref/Pluralsight.Crypto.dll b/src/ClientFaux/Ref/Pluralsight.Crypto.dll similarity index 100% rename from ClientFaux/Ref/Pluralsight.Crypto.dll rename to src/ClientFaux/Ref/Pluralsight.Crypto.dll diff --git a/ClientFaux/log4net.config b/src/ClientFaux/log4net.config similarity index 100% rename from ClientFaux/log4net.config rename to src/ClientFaux/log4net.config diff --git a/ClientFaux/packages.config b/src/ClientFaux/packages.config similarity index 100% rename from ClientFaux/packages.config rename to src/ClientFaux/packages.config