Skip to content

Commit

Permalink
Adding new examples for the DSC resources in this module (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielboth authored Aug 1, 2022
1 parent c4a183e commit b97c82b
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- xRemoteDesktopSessionHost
- New examples for the resources

### Changed

- xRemoteDesktopSessionHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ class MSFT_xRDServer : OMI_BaseResource

[write] string GatewayExternalFqdn;
};

Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,3 @@ function Test-TargetResource
}

Export-ModuleMember -Function *-TargetResource

12 changes: 12 additions & 0 deletions source/Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@

This will help to understand how to setup certain scenarios with the
xRemoteDesktopSessionHost resource module.

## Resource examples

These are the links to the examples for each individual resource.

- [xRDGatewayConfiguration](Resources/xRDGatewayConfiguration)
- [xRDLicenseConfiguration](Resources/xRDLicenseConfiguration)
- [xRDRemoteApp](Resources/xRDRemoteApp)
- [xRDServer](Resources/xRDServer)
- [xRDSessionCollection](Resources/xRDSessionCollection)
- [xRDSessionCollectionConfiguration](Resources/xRDSessionCollectionConfiguration)
- [xRDSessionDeployment](Resources/xRDSessionDeployment)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<#
.DESCRIPTION
This example shows how to ensure that the Remote Desktop Gateway is setup.
#>

Configuration Example
{
Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDGatewayConfiguration MyGateway {
ConnectionBroker = 'connectionbroker.server.fqdn'
GatewayServer = 'gateway.server.fqdn'
GatewayMode = 'Automatic'
ExternalFqdn = 'gateway.external.fqdn'
LogonMethod = 'AllowUserToSelectDuringConnection'
UseCachedCredentials = $false
BypassLocal = $false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<#
.DESCRIPTION
This example shows how to ensure that the Remote Desktop Licensing is setup in the correct mode.
#>

Configuration Example
{

Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDLicenseConfiguration MyLicenseServer {
ConnectionBroker = 'connectionbroker.server.fqdn'
LicenseMode = 'PerUser'
LicenseServer = 'license.server.fqdn'
}
}
}
27 changes: 27 additions & 0 deletions source/Examples/Resources/xRDRemoteApp/1-CreateRemoteApp.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<#
.DESCRIPTION
This example shows how to ensure deploy PowerShell as a RemoteApp.
#>

Configuration Example
{

Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDRemoteApp 'Notepad' {
Alias = 'PowerShell without Profile'
CollectionName = 'BD_Python_Apps'
CommandLineSetting = 'Require'
DisplayName = 'PowerShell'
FilePath = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
FolderName = ''
IconPath = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
RequiredCommandLine = '-noprofile'
ShowInWebAccess = $True
UserGroups = ''
FileVirtualPath = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
}
}
}
19 changes: 19 additions & 0 deletions source/Examples/Resources/xRDServer/1-JoinRDSHost.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<#
.DESCRIPTION
This example shows how to join a RDSH host to a deployment.
#>

Configuration Example
{

Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDServer RemoteDesktopSessionHost {
ConnectionBroker = 'connectionbroker.server.fqdn'
Server = 'sessionhost.server.fqdn'
Role = 'RDS-RD-Server'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<#
.DESCRIPTION
This example shows how to ensure a session collection is created.
#>

Configuration Example
{
Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDSessionCollection 'MyCollection' {
CollectionName = 'ExampleApplications'
SessionHost = 'sessionhost.server.fqdn'
ConnectionBroker = 'connectionbroker.server.fqdn'
CollectionDescription = 'A collection to deploy example applications'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<#
.DESCRIPTION
This example shows how to ensure a session collection is configured.
#>

Configuration Example
{
Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDSessionCollectionConfiguration 'ExampleApplications' {
CollectionName = 'ExampleApplications'
CollectionDescription = 'A collection to deploy example applications'
ConnectionBroker = 'connectionbroker.server.fqdn'
UserGroup = 'DOMAIN\AllowedUsersGroup'
ActiveSessionLimitMin = 0
BrokenConnectionAction = 'Disconnect'
AutomaticReconnectionEnabled = $True
DisconnectedSessionLimitMin = 30
IdleSessionLimitMin = 1440 # One day
TemporaryFoldersDeletedOnExit = $True
RDEasyPrintDriverEnabled = 0
MaxRedirectedMonitors = 16
ClientPrinterRedirected = 0
ClientDeviceRedirectionOptions = 'AudioVideoPlayBack, AudioRecording, Clipboard'
ClientPrinterAsDefault = 0
AuthenticateUsingNLA = $True
EncryptionLevel = 'High'
SecurityLayer = 'SSL'
EnableUserProfileDisk = $True
DiskPath = '\\file.server.fqdn\RDSProfileShare'
MaxUserProfileDiskSizeGB = 5
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<#
.DESCRIPTION
This example shows how to ensure a session deployment is created.
#>

Configuration Example
{
Import-DscResource -ModuleName 'xRemoteDesktopSessionHost'

Node localhost {

xRDSessionDeployment RDSDeployment {
SessionHost = 'rdsessionhost.server.fqdn'
ConnectionBroker = 'connectionbroker.server.fqdn'
WebAccessServer = 'webaccess.server.fqdn'
}
}
}
1 change: 0 additions & 1 deletion source/Modules/xRemoteDesktopSessionHostCommon.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,3 @@ PrivateData = @{
# DefaultCommandPrefix = ''

}

7 changes: 0 additions & 7 deletions source/xRemoteDesktopSessionHost.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@

} # End of PrivateData hashtable
}







0 comments on commit b97c82b

Please sign in to comment.