Remote Desktop Log-where to start? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Jonvy · 2018-10-06 12:02 Hi all, I'm considering to make a software to log on every PCs in local network. I want to monitor every PC's memory usually and free disk space, this is one of my daily work. I need this software so I can know if each PC's status in my office, it can save a lot of time to check each PC one by one, there are too many PCs in my company. But I don't know how to start to do this? I have experience to make program use TCP socket to transfer data between PC, but I never make program to remote log on one PC. Is someone can help me how to start? Thanks! Jonvy ---------------------------------------------------------------------- msnrw · 2018-10-06 14:13 Hey Jonvy, can you give some insights about the OS of the Systems in question? Maybe set up a client/server approach: gather infos to monitor with a client as service in background and send them to the monitor server. Did you do a research? I think there might possibly a solution out of the box... no means to offend you, but before you reinvent the wheel?? ---------------------------------------------------------------------- Jonvy · 2018-10-06 14:27 The OS is windows7 or Windows10. ---------------------------------------------------------------------- msnrw · 2018-10-06 22:45 Hi Jonvy, for Win there is typeperf as a cli program: https://superuser.com/questions/407750/command-line-resource-monitor- for-windows With this you could tinker a proof of concept: execute it every x times from your own program. Cut the infos you need and send them to the other machine. Hope this gets you started... ---------------------------------------------------------------------- Jonvy · 2018-10-09 01:22 Thanks msnrw, I use typeperf get the info I need, but looks like this tool can only works in local machine. If I use this tool to type remote PC name,it will get error. In this way, I need make client/server program in both PC. Is there any tools, so I can get directly remote PC's info? Jonvy ---------------------------------------------------------------------- af0815 · 2018-10-09 04:27 This is more a windowsquestion than a pascal question. All programs able to do this are in client server architekture. This is also a security rights problematic. Every Information you can query from another PC is evil, so it is normaly forbidden to get this and such info. In windows you can query some infos by remote WMI, but this must be handled by the admins to make this possible. Because this can be a security risk and is normaly not used. ---------------------------------------------------------------------- 440bx · 2018-10-09 05:26 Jonvy, If you are not familiar with Powershell, you should probably look into it.  Powershell eases system administration quite a bit and can do a whole lot more than what you are asking for.  Another nice thing is, it is fairly easy to learn. HTH ---------------------------------------------------------------------- Jonvy · 2018-10-10 14:24 Thanks 440bx, I look into Powershell, it's very useful and can get information from remote PC. I meet another problem when I using Powershell with Lazarus. I want to get output from Powershell to my program. But when I run following code, Powershell  doesn't return result and my program waiting, only when I close Powershell, then my program can get result. Can you help me where is wrong for my code? Code as here: procedure TForm1.btnPowerShellClick(Sender: TObject); var   Process2: TProcess; begin   Memo2.Clear;   Process2:=TProcess.Create(Form1);   Process2.Options:=[poUsePipes,poWaitOnExit,poStderrToOutPut];   Process2.Executable:='PowerShell.exe';   Process2.Parameters.Add('Get-WmiObject -Class Win32_BIOS -ComputerName .');   Process2.Active:=True;   Memo2.Lines.LoadFromStream(Process2.Output); end; ---------------------------------------------------------------------- 440bx · 2018-10-10 15:23 Quote from: Jonvy on October 10, 2018, 04:24:44 pmThanks 440bx, I look into Powershell, it's very useful and can get information from remote PC. Can you help me where is wrong for my code? You're welcome, I'm pleased you found the suggestion useful. Unfortunately, I cannot offer any assistance with the  code you posted.  I do everything using the Windows API.  I have little to no knowledge of Lazarus components. Hopefully the people knowledgeable with Lazarus components can help you with that. ---------------------------------------------------------------------- lucamar · 2018-10-10 15:50 Quote from: Jonvy on October 10, 2018, 04:24:44 pm[...]  Powershell  doesn't return result and my program waiting, only when I close Powershell, then my program can get result. I'm no expert either but I think you problem is with Process2.Options:=[poUsePipes,poWaitOnExit,poStderrToOutPut]; IIRC, poWaitOnExit causes the callee to lock until the spawned process ends.