Skip to content

Foxdeploy/refactor #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ClientFaux.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added Images/docs_01_fcmsettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/docs_02_settings02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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`
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AppSettings.cs" />
<Compile Include="StatusViewClasses.cs" />
<Compile Include="Models\AppSettings.cs" />
<Compile Include="Models\CustomClientRecord.cs" />
<Compile Include="Models\Device.cs" />
<Compile Include="Models\StatusEnum.cs" />
<Compile Include="Models\StatusViewClasses.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand All @@ -110,7 +113,7 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="FauxDeployCMAgent.cs" />
<Compile Include="Models\FauxDeployCMAgent.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down Expand Up @@ -140,6 +143,7 @@
<Content Include="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Models\.editorconfig" />
<None Include="packages.config" />
<None Include="Properties\LICENSE">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/ClientFaux/Models/.editorconfig
Original file line number Diff line number Diff line change
@@ -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]

File renamed without changes.
11 changes: 11 additions & 0 deletions src/ClientFaux/Models/CustomClientRecord.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CMFaux
{
public partial class Models
{
public class CustomClientRecord
{
public string RecordName { get; set; }
public string RecordValue { get; set; }
}
}
}
64 changes: 64 additions & 0 deletions src/ClientFaux/Models/Device.cs
Original file line number Diff line number Diff line change
@@ -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));
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 16 additions & 0 deletions src/ClientFaux/Models/StatusEnum.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace CMFaux
{
public class CMFauxStatusViewClasses
public partial class CMFauxStatusViewClasses
{
public static List<String> GetWMIClasses()
{
Expand All @@ -25,98 +25,31 @@ public static List<String> 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();
Expand All @@ -131,7 +64,4 @@ public CMFauxStatusViewClassesFixedOSRecord()
}
}
}



}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.