How do I create an RDP session or file to multiple user with %userprofile%?












0















I have this code to setup a RDP Connection manager but it need it to user MSTSC to multiple users whom vary from computer to computer. I have tried to use %userprofile%desktopDesktop.rdp but it doesn't work correctly. This is the code I have used



########################################################################### 
#
# NAME: New-MSTSCFile.ps1
#
# AUTHOR: Markus Lassfolk
# EMAIL: markus.lassfolk@truesec.se
#
# Original AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create an txt-file for use with Microsoft Remote Desktop Connection Manager
# For more details, see the following blog-post: http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list
#
# You have a royalty-free right to use, modify, reproduce, and
# distribute this script file in any way you find useful, provided that
# you agree that the creator, owner above has no warranty, obligations,
# or liability for such use.
#
# VERSION HISTORY:
# 2.1 19/08/2015 - Creating a Default Profile based on your UserName and Domain
# - Assume RDGW Address is rdgw.your.domain.fqdn if incorrect, set it manually.
#
# 2.0 15/07/2015 - Updated for MSTSC 2.7
# - Only including ComputerObjects (no ClusterNames etc)
# - Only including Enabled Computer objects
# - Adds Computer Description as Comment
# - Not using a Group. Felt no need for that as there is just one environment in each RDG File
# - Support for Providing a RDGateway Address
# - Changed file name to reflect FQDN of Domain (we have several customers with the same Netbios name)
# - Sort servers alphabetically in the list.
#
# 1.0 02.06.2010 - Initial release
#
###########################################################################

#Importing Microsoft`s PowerShell-module for administering Active Directory
Import-Module ActiveDirectory

#Initial variables
$EnableRDGW = $true # set to: $false if RDGW should not be used
$RDGW = "rdgw.cmrinc.com" # Enter External RDGW Address if this is incorrect.


#$domain = $env:userdomain
$OutputFile = "$homedesktopCMR_Desktop.rdg"


#Create a template txt
$template = @'
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:1
videoplaybackmode:i:1
connection type:i:2
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:rdshost.cmrinc.com
audiomode:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:rdsgw.cmrinc.com
gatewayusagemethod:i:1
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:1
promptcredentialonce:i:1
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
drivestoredirect:s:
set audioqualitymode:1:2
span monitors:i:0
use multimon:i:0
session bpp:i:24
'@

#Output template to txt-file
$template | Out-File $homeCMR_Desktop.rdp l

#Load template into txt object
$txt = New-Object text
$txt.Load("$homeCMR_Desktop.rdp")

#Set file properties
$file = (@($txt.MSTSC.file.properties)[0]).Clone()
$file.name = "CMR_Desktop.rdp"
$txt.MSTSC.file.properties | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.ReplaceChild($file,$_) }

# Set RDGW Server Address

if ($EnableRDGW -eq $true) {
$txt.MSTSC.file.gatewaySettings.hostName = $RDGW
$txt.MSTSC.file.gatewaySettings.enabled = "True"
}

# Create a Profile with your current username and domain
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.profileName.'#text' = "CMR_Desktop.r"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.userName = "InfinityText"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.domain = "CMRINC.com"
$txt.MSTSC.file.logonCredentials.profileName.'#text' = "InfinityTest"
$txt.MSTSC.file.gatewaySettings.profileName.'#text' = "InfinityTest"




#Use template to add servers from Active Directory to txt
$server = (@($txt.MSTSC.file.server)[0]).Clone()
#get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name | select name,dnshostname,description |
ForEach-Object {
$server = $server.clone()
$server.DisplayName = $_.Name
$server.Name = $_.DNSHostName
if ($_.Description -ne $Null) {
$server.comment = $_.Description
}
else {
$server.comment = ""
}
#
$txt.MSTSC.file.AppendChild($server) > $null}
#Remove template server
#`$txt.MSTSC.file.server | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.RemoveChild($_) }


#Save txt to file
$txt.Save($OutputFile)

#Remove template txt-file
Remove-Item $homeMSTSC-template.txt -Force

Write-Output "$OutputFile Created"


It has all the settings for my RDP session.










share|improve this question

























  • Never mind i figured it out.

    – James
    Dec 19 '18 at 20:58
















0















I have this code to setup a RDP Connection manager but it need it to user MSTSC to multiple users whom vary from computer to computer. I have tried to use %userprofile%desktopDesktop.rdp but it doesn't work correctly. This is the code I have used



########################################################################### 
#
# NAME: New-MSTSCFile.ps1
#
# AUTHOR: Markus Lassfolk
# EMAIL: markus.lassfolk@truesec.se
#
# Original AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create an txt-file for use with Microsoft Remote Desktop Connection Manager
# For more details, see the following blog-post: http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list
#
# You have a royalty-free right to use, modify, reproduce, and
# distribute this script file in any way you find useful, provided that
# you agree that the creator, owner above has no warranty, obligations,
# or liability for such use.
#
# VERSION HISTORY:
# 2.1 19/08/2015 - Creating a Default Profile based on your UserName and Domain
# - Assume RDGW Address is rdgw.your.domain.fqdn if incorrect, set it manually.
#
# 2.0 15/07/2015 - Updated for MSTSC 2.7
# - Only including ComputerObjects (no ClusterNames etc)
# - Only including Enabled Computer objects
# - Adds Computer Description as Comment
# - Not using a Group. Felt no need for that as there is just one environment in each RDG File
# - Support for Providing a RDGateway Address
# - Changed file name to reflect FQDN of Domain (we have several customers with the same Netbios name)
# - Sort servers alphabetically in the list.
#
# 1.0 02.06.2010 - Initial release
#
###########################################################################

#Importing Microsoft`s PowerShell-module for administering Active Directory
Import-Module ActiveDirectory

#Initial variables
$EnableRDGW = $true # set to: $false if RDGW should not be used
$RDGW = "rdgw.cmrinc.com" # Enter External RDGW Address if this is incorrect.


#$domain = $env:userdomain
$OutputFile = "$homedesktopCMR_Desktop.rdg"


#Create a template txt
$template = @'
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:1
videoplaybackmode:i:1
connection type:i:2
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:rdshost.cmrinc.com
audiomode:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:rdsgw.cmrinc.com
gatewayusagemethod:i:1
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:1
promptcredentialonce:i:1
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
drivestoredirect:s:
set audioqualitymode:1:2
span monitors:i:0
use multimon:i:0
session bpp:i:24
'@

#Output template to txt-file
$template | Out-File $homeCMR_Desktop.rdp l

#Load template into txt object
$txt = New-Object text
$txt.Load("$homeCMR_Desktop.rdp")

#Set file properties
$file = (@($txt.MSTSC.file.properties)[0]).Clone()
$file.name = "CMR_Desktop.rdp"
$txt.MSTSC.file.properties | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.ReplaceChild($file,$_) }

# Set RDGW Server Address

if ($EnableRDGW -eq $true) {
$txt.MSTSC.file.gatewaySettings.hostName = $RDGW
$txt.MSTSC.file.gatewaySettings.enabled = "True"
}

# Create a Profile with your current username and domain
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.profileName.'#text' = "CMR_Desktop.r"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.userName = "InfinityText"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.domain = "CMRINC.com"
$txt.MSTSC.file.logonCredentials.profileName.'#text' = "InfinityTest"
$txt.MSTSC.file.gatewaySettings.profileName.'#text' = "InfinityTest"




#Use template to add servers from Active Directory to txt
$server = (@($txt.MSTSC.file.server)[0]).Clone()
#get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name | select name,dnshostname,description |
ForEach-Object {
$server = $server.clone()
$server.DisplayName = $_.Name
$server.Name = $_.DNSHostName
if ($_.Description -ne $Null) {
$server.comment = $_.Description
}
else {
$server.comment = ""
}
#
$txt.MSTSC.file.AppendChild($server) > $null}
#Remove template server
#`$txt.MSTSC.file.server | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.RemoveChild($_) }


#Save txt to file
$txt.Save($OutputFile)

#Remove template txt-file
Remove-Item $homeMSTSC-template.txt -Force

Write-Output "$OutputFile Created"


It has all the settings for my RDP session.










share|improve this question

























  • Never mind i figured it out.

    – James
    Dec 19 '18 at 20:58














0












0








0








I have this code to setup a RDP Connection manager but it need it to user MSTSC to multiple users whom vary from computer to computer. I have tried to use %userprofile%desktopDesktop.rdp but it doesn't work correctly. This is the code I have used



########################################################################### 
#
# NAME: New-MSTSCFile.ps1
#
# AUTHOR: Markus Lassfolk
# EMAIL: markus.lassfolk@truesec.se
#
# Original AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create an txt-file for use with Microsoft Remote Desktop Connection Manager
# For more details, see the following blog-post: http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list
#
# You have a royalty-free right to use, modify, reproduce, and
# distribute this script file in any way you find useful, provided that
# you agree that the creator, owner above has no warranty, obligations,
# or liability for such use.
#
# VERSION HISTORY:
# 2.1 19/08/2015 - Creating a Default Profile based on your UserName and Domain
# - Assume RDGW Address is rdgw.your.domain.fqdn if incorrect, set it manually.
#
# 2.0 15/07/2015 - Updated for MSTSC 2.7
# - Only including ComputerObjects (no ClusterNames etc)
# - Only including Enabled Computer objects
# - Adds Computer Description as Comment
# - Not using a Group. Felt no need for that as there is just one environment in each RDG File
# - Support for Providing a RDGateway Address
# - Changed file name to reflect FQDN of Domain (we have several customers with the same Netbios name)
# - Sort servers alphabetically in the list.
#
# 1.0 02.06.2010 - Initial release
#
###########################################################################

#Importing Microsoft`s PowerShell-module for administering Active Directory
Import-Module ActiveDirectory

#Initial variables
$EnableRDGW = $true # set to: $false if RDGW should not be used
$RDGW = "rdgw.cmrinc.com" # Enter External RDGW Address if this is incorrect.


#$domain = $env:userdomain
$OutputFile = "$homedesktopCMR_Desktop.rdg"


#Create a template txt
$template = @'
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:1
videoplaybackmode:i:1
connection type:i:2
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:rdshost.cmrinc.com
audiomode:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:rdsgw.cmrinc.com
gatewayusagemethod:i:1
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:1
promptcredentialonce:i:1
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
drivestoredirect:s:
set audioqualitymode:1:2
span monitors:i:0
use multimon:i:0
session bpp:i:24
'@

#Output template to txt-file
$template | Out-File $homeCMR_Desktop.rdp l

#Load template into txt object
$txt = New-Object text
$txt.Load("$homeCMR_Desktop.rdp")

#Set file properties
$file = (@($txt.MSTSC.file.properties)[0]).Clone()
$file.name = "CMR_Desktop.rdp"
$txt.MSTSC.file.properties | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.ReplaceChild($file,$_) }

# Set RDGW Server Address

if ($EnableRDGW -eq $true) {
$txt.MSTSC.file.gatewaySettings.hostName = $RDGW
$txt.MSTSC.file.gatewaySettings.enabled = "True"
}

# Create a Profile with your current username and domain
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.profileName.'#text' = "CMR_Desktop.r"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.userName = "InfinityText"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.domain = "CMRINC.com"
$txt.MSTSC.file.logonCredentials.profileName.'#text' = "InfinityTest"
$txt.MSTSC.file.gatewaySettings.profileName.'#text' = "InfinityTest"




#Use template to add servers from Active Directory to txt
$server = (@($txt.MSTSC.file.server)[0]).Clone()
#get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name | select name,dnshostname,description |
ForEach-Object {
$server = $server.clone()
$server.DisplayName = $_.Name
$server.Name = $_.DNSHostName
if ($_.Description -ne $Null) {
$server.comment = $_.Description
}
else {
$server.comment = ""
}
#
$txt.MSTSC.file.AppendChild($server) > $null}
#Remove template server
#`$txt.MSTSC.file.server | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.RemoveChild($_) }


#Save txt to file
$txt.Save($OutputFile)

#Remove template txt-file
Remove-Item $homeMSTSC-template.txt -Force

Write-Output "$OutputFile Created"


It has all the settings for my RDP session.










share|improve this question
















I have this code to setup a RDP Connection manager but it need it to user MSTSC to multiple users whom vary from computer to computer. I have tried to use %userprofile%desktopDesktop.rdp but it doesn't work correctly. This is the code I have used



########################################################################### 
#
# NAME: New-MSTSCFile.ps1
#
# AUTHOR: Markus Lassfolk
# EMAIL: markus.lassfolk@truesec.se
#
# Original AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create an txt-file for use with Microsoft Remote Desktop Connection Manager
# For more details, see the following blog-post: http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list
#
# You have a royalty-free right to use, modify, reproduce, and
# distribute this script file in any way you find useful, provided that
# you agree that the creator, owner above has no warranty, obligations,
# or liability for such use.
#
# VERSION HISTORY:
# 2.1 19/08/2015 - Creating a Default Profile based on your UserName and Domain
# - Assume RDGW Address is rdgw.your.domain.fqdn if incorrect, set it manually.
#
# 2.0 15/07/2015 - Updated for MSTSC 2.7
# - Only including ComputerObjects (no ClusterNames etc)
# - Only including Enabled Computer objects
# - Adds Computer Description as Comment
# - Not using a Group. Felt no need for that as there is just one environment in each RDG File
# - Support for Providing a RDGateway Address
# - Changed file name to reflect FQDN of Domain (we have several customers with the same Netbios name)
# - Sort servers alphabetically in the list.
#
# 1.0 02.06.2010 - Initial release
#
###########################################################################

#Importing Microsoft`s PowerShell-module for administering Active Directory
Import-Module ActiveDirectory

#Initial variables
$EnableRDGW = $true # set to: $false if RDGW should not be used
$RDGW = "rdgw.cmrinc.com" # Enter External RDGW Address if this is incorrect.


#$domain = $env:userdomain
$OutputFile = "$homedesktopCMR_Desktop.rdg"


#Create a template txt
$template = @'
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:1
videoplaybackmode:i:1
connection type:i:2
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:rdshost.cmrinc.com
audiomode:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:rdsgw.cmrinc.com
gatewayusagemethod:i:1
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:1
promptcredentialonce:i:1
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
drivestoredirect:s:
set audioqualitymode:1:2
span monitors:i:0
use multimon:i:0
session bpp:i:24
'@

#Output template to txt-file
$template | Out-File $homeCMR_Desktop.rdp l

#Load template into txt object
$txt = New-Object text
$txt.Load("$homeCMR_Desktop.rdp")

#Set file properties
$file = (@($txt.MSTSC.file.properties)[0]).Clone()
$file.name = "CMR_Desktop.rdp"
$txt.MSTSC.file.properties | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.ReplaceChild($file,$_) }

# Set RDGW Server Address

if ($EnableRDGW -eq $true) {
$txt.MSTSC.file.gatewaySettings.hostName = $RDGW
$txt.MSTSC.file.gatewaySettings.enabled = "True"
}

# Create a Profile with your current username and domain
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.profileName.'#text' = "CMR_Desktop.r"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.userName = "InfinityText"
$txt.MSTSC.file.credentialsProfiles.credentialsProfile.domain = "CMRINC.com"
$txt.MSTSC.file.logonCredentials.profileName.'#text' = "InfinityTest"
$txt.MSTSC.file.gatewaySettings.profileName.'#text' = "InfinityTest"




#Use template to add servers from Active Directory to txt
$server = (@($txt.MSTSC.file.server)[0]).Clone()
#get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name | select name,dnshostname,description |
ForEach-Object {
$server = $server.clone()
$server.DisplayName = $_.Name
$server.Name = $_.DNSHostName
if ($_.Description -ne $Null) {
$server.comment = $_.Description
}
else {
$server.comment = ""
}
#
$txt.MSTSC.file.AppendChild($server) > $null}
#Remove template server
#`$txt.MSTSC.file.server | Where-Object { $_.Name -eq "" } | ForEach-Object { [void]$txt.MSTSC.file.RemoveChild($_) }


#Save txt to file
$txt.Save($OutputFile)

#Remove template txt-file
Remove-Item $homeMSTSC-template.txt -Force

Write-Output "$OutputFile Created"


It has all the settings for my RDP session.







remote-desktop powershell environment-variables remote-access






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 19 '18 at 16:18









Ahmed Ashour

1,144611




1,144611










asked Dec 19 '18 at 16:01









JamesJames

184




184













  • Never mind i figured it out.

    – James
    Dec 19 '18 at 20:58



















  • Never mind i figured it out.

    – James
    Dec 19 '18 at 20:58

















Never mind i figured it out.

– James
Dec 19 '18 at 20:58





Never mind i figured it out.

– James
Dec 19 '18 at 20:58










1 Answer
1






active

oldest

votes


















0














First Powershell script is to create the RDP File



#Create RDP

New-Item -Path ~desktop -Name 'CMR Desktop.rdp' -ItemType file


#Config RDP Settings
#invoke-expression -Command .Config_RDP_Settings.ps1
& .Config_RDP_Settings.ps1

#Pauses the process
Pause


Then Configure the file with the parameters I wanted since the file created was an empty file



#Add setting to CMR Desktop.rdp file
ls "~desktopCMR Desktop.rdp" | %{ "screen mode id:i:2" | Out-File $_.FullName -
append -encoding ASCII}
ls "~desktopCMR Desktop.rdp" | %{ "session bpp:i:24" | Out-File $_.FullName -append
-encoding ASCII}
ls "~desktopCMR Desktop.rdp" | %{ "winposstr:s:0,3,0,0,800,600" | Out-File
$_.FullName -append -encoding ASCII}
ls "~desktopCMR Desktop.rdp" | %{ "compression:i:1" | Out-File $_.FullName -append
-encoding ASCII}
ls "~desktopCMR Desktop.rdp" | %{ "keyboardhook:i:2" | Out-File $_.FullName -append
-encoding ASCII}


I had to do this for each of the settings I wanted in the file for the RDP Session






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385961%2fhow-do-i-create-an-rdp-session-or-file-to-multiple-user-with-userprofile%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    First Powershell script is to create the RDP File



    #Create RDP

    New-Item -Path ~desktop -Name 'CMR Desktop.rdp' -ItemType file


    #Config RDP Settings
    #invoke-expression -Command .Config_RDP_Settings.ps1
    & .Config_RDP_Settings.ps1

    #Pauses the process
    Pause


    Then Configure the file with the parameters I wanted since the file created was an empty file



    #Add setting to CMR Desktop.rdp file
    ls "~desktopCMR Desktop.rdp" | %{ "screen mode id:i:2" | Out-File $_.FullName -
    append -encoding ASCII}
    ls "~desktopCMR Desktop.rdp" | %{ "session bpp:i:24" | Out-File $_.FullName -append
    -encoding ASCII}
    ls "~desktopCMR Desktop.rdp" | %{ "winposstr:s:0,3,0,0,800,600" | Out-File
    $_.FullName -append -encoding ASCII}
    ls "~desktopCMR Desktop.rdp" | %{ "compression:i:1" | Out-File $_.FullName -append
    -encoding ASCII}
    ls "~desktopCMR Desktop.rdp" | %{ "keyboardhook:i:2" | Out-File $_.FullName -append
    -encoding ASCII}


    I had to do this for each of the settings I wanted in the file for the RDP Session






    share|improve this answer




























      0














      First Powershell script is to create the RDP File



      #Create RDP

      New-Item -Path ~desktop -Name 'CMR Desktop.rdp' -ItemType file


      #Config RDP Settings
      #invoke-expression -Command .Config_RDP_Settings.ps1
      & .Config_RDP_Settings.ps1

      #Pauses the process
      Pause


      Then Configure the file with the parameters I wanted since the file created was an empty file



      #Add setting to CMR Desktop.rdp file
      ls "~desktopCMR Desktop.rdp" | %{ "screen mode id:i:2" | Out-File $_.FullName -
      append -encoding ASCII}
      ls "~desktopCMR Desktop.rdp" | %{ "session bpp:i:24" | Out-File $_.FullName -append
      -encoding ASCII}
      ls "~desktopCMR Desktop.rdp" | %{ "winposstr:s:0,3,0,0,800,600" | Out-File
      $_.FullName -append -encoding ASCII}
      ls "~desktopCMR Desktop.rdp" | %{ "compression:i:1" | Out-File $_.FullName -append
      -encoding ASCII}
      ls "~desktopCMR Desktop.rdp" | %{ "keyboardhook:i:2" | Out-File $_.FullName -append
      -encoding ASCII}


      I had to do this for each of the settings I wanted in the file for the RDP Session






      share|improve this answer


























        0












        0








        0







        First Powershell script is to create the RDP File



        #Create RDP

        New-Item -Path ~desktop -Name 'CMR Desktop.rdp' -ItemType file


        #Config RDP Settings
        #invoke-expression -Command .Config_RDP_Settings.ps1
        & .Config_RDP_Settings.ps1

        #Pauses the process
        Pause


        Then Configure the file with the parameters I wanted since the file created was an empty file



        #Add setting to CMR Desktop.rdp file
        ls "~desktopCMR Desktop.rdp" | %{ "screen mode id:i:2" | Out-File $_.FullName -
        append -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "session bpp:i:24" | Out-File $_.FullName -append
        -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "winposstr:s:0,3,0,0,800,600" | Out-File
        $_.FullName -append -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "compression:i:1" | Out-File $_.FullName -append
        -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "keyboardhook:i:2" | Out-File $_.FullName -append
        -encoding ASCII}


        I had to do this for each of the settings I wanted in the file for the RDP Session






        share|improve this answer













        First Powershell script is to create the RDP File



        #Create RDP

        New-Item -Path ~desktop -Name 'CMR Desktop.rdp' -ItemType file


        #Config RDP Settings
        #invoke-expression -Command .Config_RDP_Settings.ps1
        & .Config_RDP_Settings.ps1

        #Pauses the process
        Pause


        Then Configure the file with the parameters I wanted since the file created was an empty file



        #Add setting to CMR Desktop.rdp file
        ls "~desktopCMR Desktop.rdp" | %{ "screen mode id:i:2" | Out-File $_.FullName -
        append -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "session bpp:i:24" | Out-File $_.FullName -append
        -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "winposstr:s:0,3,0,0,800,600" | Out-File
        $_.FullName -append -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "compression:i:1" | Out-File $_.FullName -append
        -encoding ASCII}
        ls "~desktopCMR Desktop.rdp" | %{ "keyboardhook:i:2" | Out-File $_.FullName -append
        -encoding ASCII}


        I had to do this for each of the settings I wanted in the file for the RDP Session







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 7 at 18:53









        JamesJames

        184




        184






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385961%2fhow-do-i-create-an-rdp-session-or-file-to-multiple-user-with-userprofile%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀