RDP maximum clients with PS

How can i configure my server with RDP connection for 4 different users using a
powershell script?.

RDS isn’t directly instrumented in PowerShell. See https://social.technet.microsoft.com/Forums/office/en-US/323d6bab-e3a9-4d9d-8fa8-dc4277be1729/enable-remote-desktop-connections-with-powershell?forum=winserverpowershell as a starting point for a workaround.

I was asking about how can the PowerShell modify an object inside the Local Group Policy.
I can perform this option over GUI> Run: gpedit.msc>Computer Configuration>Administrative Templates> Windows Components> Remote Desktop Services> Remote Desktop Session Host> Connections> Limit number of connections.

I’ve searched about how PowerShell can modify Local Group Policy and I found this link:-
https://www.powershellgallery.com/packages/Carbon/2.4.0
and this for Brandon Padgett
http://brandonpadgett.com/powershell/Local-gpo-powershell/

Unfortunately I have no experience with PowerShell, and this task have to be done ASAP.
I’d really appreciate your help.

Usually we don’t write scripts on request. If you’re looking for prewritten sripts you could try it here: Microsoft Technet Script Gallery.

Mostly Goup Policies are just registry settings. You might search for the setting you need and set or change that with Powershell or any other technology you’re familiar with.