Skip to content

Commit

Permalink
now uses relative path for log and cert
Browse files Browse the repository at this point in the history
  • Loading branch information
1RedOne committed Jun 14, 2018
1 parent ee53883 commit 458b2ca
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
24 changes: 21 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.ConfigurationManagement.Messaging.Sender.Http;
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
using System.Reflection;

namespace SimulateClient

Expand Down Expand Up @@ -46,16 +47,33 @@ static void Main(string[] args)
SiteCode = args[2];
MPHostName = args[3];

// Creates the text file that the trace listener will write to.
System.IO.FileStream myTraceLog = new System.IO.FileStream("C:\\temp\\myTraceLog3.txt", System.IO.FileMode.OpenOrCreate);
// Creates the text file that the trace listener will write to. @"FolderIcon\Folder.ico"
var outPutDirectory = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var logPath = outPutDirectory + "\\ClientFauxLogs.txt";
Console.WriteLine("Logging to: " + logPath);
System.IO.FileStream myTraceLog = new System.IO.FileStream(logPath, System.IO.FileMode.OpenOrCreate);

// Creates the new trace listener.
System.Diagnostics.TextWriterTraceListener myListener = new System.Diagnostics.TextWriterTraceListener(myTraceLog);
Trace.Listeners.Add(myListener);

//string DomainName = "FoxDeploy.local";
//Get the domain name and cert path
string DomainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
string CMServerName = MPHostName +"." + DomainName;
string CertPath = outPutDirectory + "\\MixedModeTestCert.pfx";

//check for a cert file, if we don't see it, give up
if (File.Exists(CertPath))
{
Console.WriteLine("Found cert file at " + CertPath);
}
else
{
Console.WriteLine("Could not find a cert PFX file at " + CertPath);
return;
}


String machineName = System.Environment.MachineName;
Console.WriteLine("Running on system[" + machineName + "], registering as [" + clientName + "]");

Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ This tool depends on you having the [ConfigMgr SDK](https://www.microsoft.com/en
2. Copy the following Microsoft.ConfigurationManagement.Messaging.dll file to the same location where you've placed the binary for this project. Default location for the needed DLL file is `C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Redistributables\Microsoft.ConfigurationManagement.Messaging.dll`
3. (e.g. If you place these files under C:\Git\AddCMClients, then place the .dll in that location as well)
4. Ensure your ConfigMgr instance is configured to 'Approve all Clients'
5. Run the binary with the following syntax

````powershell
AddClients.exe ham Pa$$word! F0x SCCM
````
Now you're ready to use AddCMClients!



#### What's here

| Version | Feature |
|---|---|
| No more hardcoded variables! | [v0.1-alpha](https://github.com/1RedOne/ClientFaux/releases/tag/alpha) |
| Flexible Cert Path | next |
| WPF GUI | v2.0 |
| PowerShell Cmdlet? | v3.0|
| Feature | Version | Done? |
|---|---|---|
| No more hardcoded variables! | [v0.1-alpha](https://github.com/1RedOne/ClientFaux/releases/tag/alpha) |✔️|
| No more hardcoded paths | v0.2-alpha |✔️|
| Flexible Cert Path | next |---|
| WPF GUI | v2.0 |---|
| PowerShell Cmdlet? | v3.0|---|

*tested on ConfigrMgr Current Branch v1802*

0 comments on commit 458b2ca

Please sign in to comment.