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

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Client for IT Pros | User experience | Remote desktop services and terminal services
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,751 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.