Hi Luc,
could you suggest on following.
1:i need to enable rdp on one of the windows vcenter .
is there any powershell command
also for somereasons not able to connect to console of that vm from webclient .
I assume you are talking about the administrative RDP on a Windows box.
If yes, you could send the following via Invoke-VMScript to the VM.
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
you mean folowing
That would work if remote sessions are configured on that server.
If it is a VM, with VMware Tools running, you could also do
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
'@
Invoke-VMScript -VM “server_on_which_rdptobeenabled" -ScriptText $code
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks luc.i m going to use it .
i got following
It looks like the credentials you use to run the cmdlet, do not have the required permissions in the guest OS.
Find an account that has these permission, and then use the GuestCredential or GuestUset/GuestPassword parameters on the Invoke-VMScript mdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
iamdoing following
$gc=get-credential
$code = @'
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
'@
Invoke-VMScript -VM “kilmanivc" -ScriptText $code -guestcredential $gc
however i get general system error.
is there any powershell way to check permissions of my account on memberserver(the one which i m working right now)
Do you get the same error as before when you provide the GuestCredentials?
The fastest way to check is to try to logon to the guest OS with that account.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i m going to check this again .however error was different .
Can you show the complete error message?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello,
To Enable Remote on windows machine use the below:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /f /v UserAuthentication /t REG_DWORD /d 0
reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0
Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Cheers,
VCIX6-NV|VCP-NV|VCP-DC|
What VMware Tools version is that?
Did you already stop/start the VMware Tools in the guest OS?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
tools version
i did not start/stop tools in guest as i dont think its needed .
Are you really sure about the guest credentials you are passing along?
Did you try to logon with those same credentials to the guest OS on the VM via a RDP session or via the console?
I saw that exact same message for incorrect guest credentials in the past.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
well the the console of vm on which i want to enable rdp is not connecting either to webclientor vsphere client .
so iam trying to run this script from a different pingable vm,and my id is part of domain admin group so i shoud have all permissions .
Could you perhaps try to run this on another VM?
Just to be able to determine if the problem is only with specific VM or with all VMs
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
ok im checking.