Solved

remote cloud server 2008 remove a role ?

Posted on 2013-06-07
2
278 Views
Last Modified: 2013-07-05
HI All ,

have a remote cloud server 2008 r2 , to witch user has added a role web rdp , but there are no TS license on the server so all RDP is lost , - still have access via vpn , is there any way to turn off the role . can't use server manager from another 2008 - will not connect WinRD client can not process request.

can access reg on remote server .

ideas ?
0
Comment
Question by:awall2012
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39251143
since u have powershell installed in both servers u can run Remove-WindowsFeature remotely on your cloud server 2008 r2.
save the script as *.ps1 file, change the $remote_pc variable to your target machine name and run it from your command window.

Function Remove-OSFeature
{
 Param(
  [Parameter(Mandatory=$true)]
  $computername,
  [Parameter(Mandatory=$true)]
  $featurename
 )
 $cmdBlock = "Import-Module ServerManager `
`$featureInstall = Remove-WindowsFeature -Name $featureName -LogPath `"`$(`$env:temp)\$($featureName).log`"
if (`$featureInstall.Success) {
	Write-Host `"$featureName removed successfully`"
	if (`$featureInstall.RestartNeeded -eq `"Yes`") {
		Write-Host `"This feature removal requires restart. Pls restart $computerName`"
	}
} else {
	Write-Error `"`$featureName could not be installed`"
	Get-Content `"`$(`$env:temp)\$($featureName).log`" | Out-Host
}"
Write-Verbose $cmdBlock
$scriptBlock = $ExecutionContext.InvokeCommand.NewScriptBlock($cmdBlock)
 Write-Verbose "Verifying if $computername has remoting enabled"
 if (Test-PSRemoting -ComputerName $computername) {
  try {
   Write-Verbose "Removing OS Feature: $featureName"
   Invoke-Command -ComputerName $computername -ScriptBlock $scriptBlock
  }
  catch {
   Write-Verbose $_
   return $false
  }
 } else {
  Write-Error "PowerShell remoting must be enabled to run this command"
  Return $false
 }
}      
$remote_pc = 'cloud server 2008 r2'
Remove-OSFeature -ComputerName $remote_pc -FeatureName RDS-Web-Access

Open in new window


i basically followed Ravikanth post here: http://www.ravichaganti.com/blog/?p=1878
0
 

Author Closing Comment

by:awall2012
ID: 39303560
thank you
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question