ServiceDeskTools 1.1.0

dotnet add package ServiceDeskTools --version 1.1.0                
NuGet\Install-Package ServiceDeskTools -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ServiceDeskTools" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ServiceDeskTools --version 1.1.0                
#r "nuget: ServiceDeskTools, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ServiceDeskTools as a Cake Addin
#addin nuget:?package=ServiceDeskTools&version=1.1.0

// Install ServiceDeskTools as a Cake Tool
#tool nuget:?package=ServiceDeskTools&version=1.1.0                

ServiceDesk

Updated to .Net 5

Ensemble d'outils pour faire de l'administration à distance pour Windows.

Active Directory

Utilisation :

var userActiveDirectory = UserActiveDirectory(adresseAD, loginAdmin, passwordAdmin);
if(userActiveDirectory.IsUserExist("john.doe"))
{
   userActiveDirectory.AddUserToGroup("john.doe", "UnidentifiedPersonGroup")
}

ou avec un Logger

var userActiveDirectory = UserActiveDirectory(adresseAD, loginAdmin, passwordAdmin, logger);
if(userActiveDirectory.IsUserExist("john.doe"))
{
  userActiveDirectory.AddUserToGroup("john.doe", "UnidentifiedPersonGroup")
}

En sortie du Logger :

Ajout de john.doe dans le groupe UnidentifiedPersonGroup

Voici la liste des méthodes pour l'active directory :

public void AddComputerToGroup(string groupName, ComputerPrincipal computer);
public void AddComputerToGroup(string groupName, string computerName);
public void AddUserToGroup(string groupName, string userName);
public void AddUserToGroup(string groupName, UserPrincipal user);
public IEnumerable<string> GetComputerGroupes(string machineName);
public HomeDirectory GetLecteurReseau(string userName);
public UserPrincipal GetUser(string name);
public IEnumerable<string> GetUserGroups(string userName);
public Task<string> GetUserSid(string userName);
public bool IsComputerExist(string machineName);
public Task<bool> IsGroupExist(string groupName);
public bool IsUserExist(string userName);
public bool IsUserMemberOf(string userName, string groupName);
public void RemoveComputerToGroup(string groupName, string computerName);
public void RemoveLecteurReseau(string userName, string directory);
public void RemoveUserToGroup(string groupName, string userName);
public void RemoveUserToGroup(string groupName, UserPrincipal user);
public void SetLecteurReseau(string userName, string lettreReseau, string directory);

WMI

Utilisation :

var wmiManager = new WmiManagement(yourLoginAdmin, yourPasswordAdmin, logger);
List<Software> softwares = await wmiManager.GetListSofware("computerName");

// vérification de la présence d'un répertoire
string pathDirectory = @"C:\\Your\\Path\\Directory";
string wqlDirectory = string.Format(@"SELECT * FROM Win32_Directory Where Name='{0}'", pathDirectory);

if(await wmiManager.IsDirectoryExistAsync(nomMachine, wqlDirectory))
{
  logger.Success(pathDirectory + " exist");
}
else
{
  logger.Warn(pathDirectory + " not exist");
}

ILogger

Le "logger" est de type ILogger dans ServiceDeskToolsCore.ILogger:

/// <summary>
/// Message pour Debug
/// </summary>
/// <param name="message"></param>
void Debug(string message);

/// <summary>
/// Message d'erreur avec son exception
/// </summary>
/// <param name="message"></param>
/// <param name="exception"></param>
void Error(string message, Exception exception);

/// <summary>
/// Message d'erreur sans Exception !
/// </summary>
/// <param name="message"></param>
void Error(string message);

/// <summary>
/// Message d'information
/// </summary>
/// <param name="messageInfo"></param>
void Info(string messageInfo);

/// <summary>
/// Message d'information success
/// </summary>
/// <param name="message"></param>
void Success(string message);

/// <summary>
/// Message d'attention
/// </summary>
/// <param name="messageWarn"></param>
void Warn(string messageWarn);
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 444 12/30/2020
1.0.0 405 11/16/2020