how to build PS script to create gpo for settings - Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits

Senthilkumar Nandhakumar 21 Reputation points
2022-03-01T06:42:25.153+00:00

Hello ,

I need a PS script to enable GPO - Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits

value should be and need to be configure on default domain policy

Is there anyway to do through in a single ps1 file ? since having a plan to deploy via Bigfix action .

Set time limit for disconnected sessions = 10 minutes
Set time limit for active but idle Remote Desktop Services sessions = 10 minutes
Set time limit for active Remote Desktop Services sessions = 30 minutes
End session when time limits reached = Enabled

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,960 questions
Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,283 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,396 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 43,986 Reputation points
    2022-03-02T15:15:33.607+00:00

    Hello @Senthilkumar Nandhakumar

    Unfortunately you can only operate different cmdlets to manage GPO, but first please check the next article to understand the pre-requisites and as knowledge base for the different cmdlets available:

    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee461027(v=technet.10)?redirectedfrom=MSDN

    Then, you can use the next article as general usage:
    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd759177(v=ws.11)?redirectedfrom=MSDN

    The powershell operations would be limited to:
    -Maintain GPOs: GPO creation, removal, backup, reporting, and import.
    -Associate GPOs with Active Directory Directory Services (AD DS) containers: Group Policy link creation, update, and removal.
    -Set inheritance and permissions on AD DS organizational units (OUs) and domains.
    -Configure registry-based policy settings and Group Policy Preferences Registry settings.

    For any policy setting in specific (for instance change from Not Defined to Enabled), you will need to apply it manually from the GPMC, then you could export, link, import, etc... using powershell.

    Hope this helps with your query,

    --
    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

0 additional answers

Sort by: Most helpful