Solved

remote cloud server 2008 remove a role ?

Posted on 2013-06-07
2
271 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Case Summary: In this Article we introduce the new method to configure the default user profile using Automated profile copy with sysprep rather than the old ways such as the manual copy of a configured profile to default user profile Old meth…
The question has been asked on multiple occasions as to how best to do printing in a remote desktop or terminal services environment.   It seems that this particular question has plagued several people and most especially as Terminal Services, as…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now