Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

remote cloud server 2008 remove a role ?

Posted on 2013-06-07
2
Medium Priority
?
284 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:
Meir Rivkin earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The environment that this is running in is SCCM 2007 R2 running on a Windows 2008 R2 server. The PXE Distribution point is running on its own Windows 2008 R2 box. This is what Event viewer showed after trying to start the WDS service:  An erro…
Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

824 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