Relatively new to C# and I am trying to remake a powershell application I built with winforms in which I made functionality to auto-populate a combobox with all local machines, and when selected it will show the relevant services for my companies application and whether the service was running and what it's startup type was. I made buttons that allowed for stop, start, restart, enable automatic and disable. I would like to translate this into a C# rebuild but I am struggling to find the C# equivalent of powershell's Set-Process and Get-Process, which allow, very easily, to get the status and change the status of services across the LAN without any special remote session being made.
I also used PsTools to close and restart our applications remotely from this app, and I would love to learn how to achieve the functionality of PsTools with C# and .NET.
My research has shown me that some of my questions can be answered in the System.Diagnostics, System.Management, and System.DirectoryServices namespaces, but when I put the latter two into a project in Visual Studio 2022 they come up as invalid namespaces.