Serial Token
This commit is contained in:
parent
85f3eb280f
commit
5e89468a71
27
README.md
27
README.md
@ -1,6 +1,6 @@
|
|||||||
[](https://healthit.com.au)
|
[](https://www.heko-bs.de/)
|
||||||
|
|
||||||
# TED (Tag Every Desktop) - a Health IT Project
|
# TED (Tag Every Desktop)
|
||||||
|
|
||||||
TED is a commandline tool, inspired by the classic [BGInfo](https://learn.microsoft.com/en-us/sysinternals/downloads/bginfo), designed for MSPs to be able to display images and text programmatically on the desktop, positioned above the wallpaper but below the icons. It utilizes the bottom right corner of the primary monitor as the drawing area.
|
TED is a commandline tool, inspired by the classic [BGInfo](https://learn.microsoft.com/en-us/sysinternals/downloads/bginfo), designed for MSPs to be able to display images and text programmatically on the desktop, positioned above the wallpaper but below the icons. It utilizes the bottom right corner of the primary monitor as the drawing area.
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ TED supports the following switches:
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
We've provided an example PowerShell script to make deploying with your RMM quick and easy. You can find the script [here.](https://github.com/HealthITAU/TED/blob/main/examples/rmm_deploy.ps1)
|
We've provided an example PowerShell script to make deploying with your RMM quick and easy. You can find the script [here.](https://git.heko-technik.de/mkrieger/TED/src/branch/main/examples/rmm_deploy.ps1)
|
||||||
|
|
||||||
TED is a CLI tool and can be called like so:
|
TED is a CLI tool and can be called like so:
|
||||||
|
|
||||||
@ -70,29 +70,12 @@ In terms of real world usage, we've found this to be a fantastic tool for helpin
|
|||||||
## Adding Tokens
|
## Adding Tokens
|
||||||
|
|
||||||
Adding Tokens to the text system is simple, but will require editing the source and compiling your own binary.
|
Adding Tokens to the text system is simple, but will require editing the source and compiling your own binary.
|
||||||
Tokens are stored within TokenLookup inside Tokenizer.cs, found [here.](https://github.com/HealthITAU/TED/blob/main/src/TED/TED.Utils/Tokenizer.cs)
|
Tokens are stored within TokenLookup inside Tokenizer.cs, found [here.](https://git.heko-technik.de/mkrieger/TED/src/branch/main/src/TED/TED.Utils/Tokenizer.cs)
|
||||||
|
|
||||||
Simply add to this dictionary your token as the key and what you'd like to subtitute it with as the value.
|
Simply add to this dictionary your token as the key and what you'd like to subtitute it with as the value.
|
||||||
Compile, and use your new tokens!
|
Compile, and use your new tokens!
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Contributions to TED are welcome! If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.
|
|
||||||
|
|
||||||
## Supporting the project
|
|
||||||
|
|
||||||
:heart: the project and would like to show your support? Please consider donating to one of our favourite charities:
|
|
||||||
- [Love Your Sister (Sam's 1000)](https://www.loveyoursister.org/makeadonation)
|
|
||||||
- [Black Dog](https://donate.blackdoginstitute.org.au/)
|
|
||||||
- [RedFrogs Australia](https://redfrogs.com.au/support/donate)
|
|
||||||
|
|
||||||
Please let us know if you have donated because of this project!
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the [GNU General Public License v3.0](https://github.com/HealthITAU/TED/blob/main/LICENSE)
|
This project is licensed under the [GNU General Public License v3.0](https://git.heko-technik.de/mkrieger/TED/src/branch/main/LICENSE)
|
||||||
|
|
||||||
## Contact
|
|
||||||
|
|
||||||
For any inquiries or further information, please contact the developers:
|
|
||||||
- [dev@healthit.com.au](mailto:dev@healthit.com.au?subject=[GitHub]%20TED%20Query)
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using Microsoft.VisualBasic.Devices;
|
using Microsoft.VisualBasic.Devices;
|
||||||
|
using System.Management;
|
||||||
|
|
||||||
namespace TED.Utils
|
namespace TED.Utils
|
||||||
{
|
{
|
||||||
@ -18,7 +19,8 @@ namespace TED.Utils
|
|||||||
{ "@userName", () => WindowsIdentity.GetCurrent().Name },
|
{ "@userName", () => WindowsIdentity.GetCurrent().Name },
|
||||||
{ "@machineName", () => Environment.MachineName },
|
{ "@machineName", () => Environment.MachineName },
|
||||||
{ "@osVersion", () => Environment.OSVersion.ToString() },
|
{ "@osVersion", () => Environment.OSVersion.ToString() },
|
||||||
{ "@osName", () => new ComputerInfo().OSFullName }
|
{ "@osName", () => new ComputerInfo().OSFullName },
|
||||||
|
{ "@machineSerial", () => GetSerial() }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,6 +40,28 @@ namespace TED.Utils
|
|||||||
|
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
private static List<string> GetSerialNumbers()
|
||||||
|
{
|
||||||
|
List<string> serialNumbers = new List<string>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var query = new ObjectQuery("SELECT * FROM Win32_BIOS");
|
||||||
|
var searcher = new ManagementObjectSearcher(query);
|
||||||
|
var results = searcher.Get();
|
||||||
|
|
||||||
|
foreach (var obj in results)
|
||||||
|
{
|
||||||
|
serialNumbers.Add(obj["SerialNumber"].ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// Handle any error gracefully or just return an empty list
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return serialNumbers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -18,9 +18,9 @@
|
|||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||||
<Company>Health IT</Company>
|
<Company>Heko Büroservice GmbH & Co. KG.</Company>
|
||||||
<Title>TED - Tag Every Desktop</Title>
|
<Title>TED - Tag Every Desktop</Title>
|
||||||
<Authors>Health IT</Authors>
|
<Authors>Heko Büroservice GmbH & Co. KG.</Authors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Open|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Open|AnyCPU'">
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user