Link to home
Start Free TrialLog in
Avatar of emag50
emag50

asked on

PowerShell Script to Create GPO that sets Remote Desktop Session Time Limits

Hey guys,

I just started working for a new company that does a lot of  Windows Server automated builds.  As you can probably guess, a lot of PowerShell scripting is involved which I have very very basic knowledge of (basically 0 knowledge).  Anyways I was given the task of creating this PS script to get my feet wet using PowerShell scripting.

We want the PS script to be able to create a GPO that changes the "Session Time Limits" settings.  

I found a very good article as a reference in creating GPOs using PowerShell.  However the example they use in the article is on how to change the "Authoritative Time Server."  I want to be able to change the "Session Time Limits."

Here's a link to the article (looks better in IE): http://carlwebster.com/creating-a-group-policy-using-microsoft-powershell-to-configure-the-authoritative-time-server/

I think I've followed the article's steps pretty well up until the part where I need to set the registry keys.

Can someone assist me or point me in the right direction in creating a scripts similar to this?  I would greatly appreciate any help.
ASKER CERTIFIED SOLUTION
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of emag50
emag50

ASKER

It does seem much easier to accomplish this using your suggested export import method using PowerShell.  Makes perfect sense as a simplified solution.  I'll go ahead and try this on the test environments.  Thanks a lot for your input.  Once I finish I'll post another comment.
Avatar of emag50

ASKER

Perfect!  Used the proper PowerShell cmdlets to export and import from one environment to another.  Now adding this to the auto build should be easy.  Thank you so much acbrown2010!
Hi emag50,

Would you please be able to share the powershell script you created with me? My email is s1.k4@outlook.com.

Thanking you in advance.
Sam