Powershell export Registry

Jonathanars

Prominent
Jul 11, 2017
3
0
510
Hello everyone,

We've been trying to create a script in powershell to export some settings to a log file which then gets sent to our email.
We've gotten pretty far with it, however we're stuck with some settings in regards to gpedit.msc
I noticed that there's no module that gets the information that we need, however I figured it might be possible with the correct regkeys by using get-ChildItem.
Of course anyone in our team has no idea which ones they are and google didn't really help.
So I figured I'd come here.

We're looking for the following under gpedit:
In gpedit.msc>Admin>Windows Components> Remote Desktop Services>Remote Desktop Session host>Connections:
Restrict Remote Desktop Services users to a single remote desktop
Allow users to connect remotely by remote desktop services

In gpedit.msc>Admin>Windows Components> Remote Desktop Services>Remote Desktop Session host>Session time limits:
Set time limit for disconnected session
Set time limit for active but idle
Set time limit for active remote desktop services session

In gpedit.msc>Admin>Windows Components>Windows Updates>Configure Automatic Updates:
Automatic Updating
Install During Automatic Maintenance
Scheduled Install Day
Scheduled install time
 

Jonathanars

Prominent
Jul 11, 2017
3
0
510
So I found the keys, but it's not letting me use get-childitem
Any recommendations?


PS C:\Windows\system32> get-childitem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E0CCC0C8-96D5-473F-8614-F8EEDF14DF97}Machine\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fDenyTSConnections"
get-childitem : Cannot find path 'HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E0CCC0C8-96D5-473F-8614-F8EEDF14DF97}Machine\SOFTWARE\Policies\Microsoft\Windows NT\Terminal
Services\fDenyTSConnections' because it does not exist.
At line:1 char:1
+ get-childitem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HKEY_CURRENT_US...nyTSConnections:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 

TRENDING THREADS