Powershell New-PSSession failing

Hi,

I am trying to execute couple of power shell commands from web role on my Domain Controller machine in my azure virtual network. Following are the commands

winrm s winrm/config/client '@{TrustedHosts="' $DomainIPAddress '"}'
$securepw = ConvertTo-SecureString $pw -asplaintext -force
$cred = new-object -typename System.Management.Automation.PSCredential -ArgumentList $username, $securepw
$session = New-PSSession -credential $cred -ComputerName $computerName
Invoke-Command -Session $session -ScriptBlock ${function:CreateCNAME} -ArgumentList $hostname, $domainname, $alias

CreateCNAME function create dns on Domain Controller. I have enabled Remote Management on my Domain Controller

I am getting power shell errors below

1. WSManFault exception

2. Program 'winrm.cmd' failed to run

Could someone help whats wrong

June 25th, 2015 10:28am

Hi,

 I am not sure if I got your scenario correctly, but below is a blog that shows how to enable remote powershell on Azure PAAS webrole
 http://blogs.msdn.com/b/golive/archive/2014/11/28/use-remote-powershell-to-manage-your-azure-paas-compute-instances.aspx
 
Regards,
Nithin Rathnakar

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 1:19am

Hi,

 I am not sure if I got your scenario correctly, but below is a blog that shows how to enable remote powershell on Azure PAAS webrole
 http://blogs.msdn.com/b/golive/archive/2014/11/28/use-remote-powershell-to-manage-your-azure-paas-compute-instances.aspx
 
Regards,
Nithin Rathnakar

June 26th, 2015 5:15am

Hi,

 I am not sure if I got your scenario correctly, but below is a blog that shows how to enable remote powershell on Azure PAAS webrole
 http://blogs.msdn.com/b/golive/archive/2014/11/28/use-remote-powershell-to-manage-your-azure-paas-compute-instances.aspx
 
Regards,
Nithin Rathnakar

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 5:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics