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