Posted by vivekcek on November 2, 2016
I was trying to host an ASP.NET 4.5 application in an Amazon EC2 instance (Windows Server 2016)
Then i got below error
CS0016: Could not write to output file ‘c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\6a5d994b\b5f46f1c\App_global.asax.o34wdr3q.dll’ — ‘Access is denied. ‘
We can solve this by below power shell script
$dir = "C:\Windows\Temp"
$acl = get-acl -path $dir
$new = "IIS_IUSRS","FullControl","ContainerInherit,ObjectInherit","None","Allow"
$accessRule = new-object System.Security.AccessControl.FileSystemAccessRule $new
$acl | Set-Acl $dir
Posted in Amazon AWS | Tagged: Access is denied, Could not write to output file 'c:\Windows\Microsoft.NET | Leave a Comment »
Posted by vivekcek on July 25, 2016
In this post i will show you how can we restart a windows ec2 instance by using powershell.
1. Go to your account, select Security Credentials and create an AWS access key and secret key.
2. Open Power-Shell for AWS, which will ask your AWS Access key and Secret Key.
3. If Power-Shell not prompted for keys go to “C:\Users\Administrator\AppData\Local\AWSToolkit” and delete the Registered Account Jsonfile and open Power-Shell again.
4. Now get your instance id by using this url from EC2 instance
5. Now from powershell give below command
Restart-EC2Instance -InstanceId i-12345678
Posted in Amazon AWS | Tagged: amzon ec2 reboot powershell, amzon powershell access key and secret key, Restart Amazon AWS EC2, Restart Amazon AWS EC2 powershell | Leave a Comment »