Configuring IIS to use a UNC share as the root of a website or application

My team was recently working on a configuration for an OrcsWeb hosting client with a very large web root folder in order to provide a load balanced web redundant solution. The clients users are able to upload files via the web interface so the data has to be synchronized rather than just a one-way replication. Due to data and HDD size constraints, DFS-R is not a viable option. As a workaround, we decided to configure a UNC share and point both nodes to the same location. We created the same share on both servers so that we could use robocopy to sync data to the standby share. This will require manual administrative work in the event of a necessary failover to the standby UNC share but it provides the data redundancy that the client desires.

Since this is a process we have done many times, we were already aware of the need to grant access to the share using the caspol command. If you need to do this in your configuration, here is a blog post that explains the process and steps to implement it. After configuring the share, the website was updated to point the the UNC share and testing began. When testing from the server that the share was hosted on, everything worked as expected. We then tested from the second server and quickly received the following error:

Exception Details: System.Security.SecurityException: Request for the permission of type ‘System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.

To verify that the appropriate permissions were available, we created a test website and pointed to a new web root UNC share that only contained a default.aspx file. We ran the caspol command to grant access remotely and were able to browse the new site from both servers.

We used procmon.exe to determine if there were any access denied errors being logged to try to narrow down the root cause of the failure. No errors were reported. I then remembered reading about the changes that were implemented with the AppPoolIdentity in IIS7; specifically that the Application Pool identity uses the machine account to access network resources. Even though we were using a domain based user account for the application pool, we decided to add the computer account with read permissions to the share. Voila, we were then able to browse the site successfully from either web node. I can not explain why this was necessary but it resolved the error we were encountering. Hopefully this will save you some time in troubleshooting UNC share access issues with IIS if you decide to implement this configuration.

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

An Isolated Approach to FTP

I have seen quite a few questions related to User Isolation and IIS FTP configuration. I wrote a guest editorial for WServerNews earlier this year that addresses the many ways to implement this. It provides a guided walk-through of implementing User Isolation for a single FTP implementation, VHN (virtual host name) FTP implementation on multiple sites for isolation, or a combination of both. I hope you find this information useful.

 

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

My first MVP Summit

On Sunday I started the trek across country from Charlotte, NC to Seattle, WA to attend my first Microsoft MVP Summit in Bellevue, WA. I wasn’t sure what to expect. I am somewhat shy when in a new place, especially when I am alone. Now, for sure, I wasn’t alone but would be joining approximately 1300 other MVPs from around the world.

While waiting to board my flight, there was a page for Scott Forsyth. Suddenly, I was no longer traveling solo. I worked with Scott at OrcsWeb so now I had a travel buddy. I knew once we landed, I would have someone who knew the ropes. We landed safely a long 6 hour flight later and met at baggage claim. We shared a taxi and caught up on old times.

I had also met Toi Wright when I spoke at her user Group conference in Dallas last month so I knew she would also be attending. Microsoft puts on great events. There was an MVP Showcase on Sunday night and in the course of that 3 hours, I was lucky enough to run into both Scott and Toi and began meeting other MVPs both in my discipline (IIS) and other technologies. Both Scott and Toi have been MVPs for many years so they already know other members of our community and were sure to introduce me while we were making our way around the Showcase and the sessions/breaks.

There was a 1st Time MVP’er event that I also attended on Sunday. This provided information on how to get the most of the event (the big secret – don’t hide in your room, get out and network).

Over the course of the Summit, I met many people that I have corresponded with virtually. I wore my Orcs Web shirt on Tuesday. Many MVPs that host sites with us came up to introduce themselves. I was also able to catch up with Brady Gaster. I worked with him many years ago and he was the person that introduced me to Orcs Web and started this awesome journey that I am now on. It was nice to be able to thank him in person.

Today, I am returning home after having a great week of networking and information exchange with my product group team. I truly enjoyed this experience. Safe travels for everyone heading back to your respective homes over the next few days. Adios until next year.

Windows Live Writer–making blogging easy

A friend of mine just relocated to Costa Rica and is starting a blog using WordPress. I use WordPress for this blog and a co-worker told me about Windows Live Writer. You can download the application here. I dreaded using any pictures or videos in my blog due to having to upload them individually through my WordPress admin interface and then insert them into my blog post. Windows Live Writer allows you to insert the pictures within your blog post and uploads them to your blog seamlessly.

Live writer can interface with many of the popular blogging applications such as WordPress and Blogger. I use WordPress so I will select that option.

image

All you need to know to configure the publishing settings is your blog URL address and your admin username/password combination.

image

Once you have entered your login credentials for you blog, you are ready to click next to continue the initial configuration. Since Live Writer could not automatically detect my settings, I needed to update the <blogname> portion of the URL to reflect my blog name. This is a newly created blog that is not publicly accessible which was the cause of this additional step.

image

I choose not to download the blog theme. That is a personal choice. If you want the theme downloaded, click Yes on this dialog box.

image

Since I am writing this post while configuring my new blog settings, I deselected Switch to this blog now and Finished the configuration.

image

You are now ready to start blogging. All posts are created within Windows Live Writer application and then either Published or draft published using the menu. Pictures can be pasted directly into the editor and the publish process takes care of uploading and linking when the post is published.

image

You can also set categories, tags, or a post date within the ribbon that are added to your post when it is published. If you write multiple blog post in a given day, you may not want all to go “Live” at the same time, so you can set the post date which will publish the blog on that date.

I hope you find this post helpful since Windows Live Writer is the best thing to come around for publishing blog posts – at least in my humble opinion.

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

PowerShell Studio by Sapien

I am an administrator that is, to be quite honest, infatuated with PowerShell. I have done some minor coding in my past; mostly using Perl and XML for repetitive administrative functions. With the introduction of PowerShell v2, I started playing around with creating simple scripts to do some of my daily tasks. I then attended The PowerShell Saturday event in Charlotte, NC last year and was able to see some of the things that PowerShell v3 can do. Well, let’s just say the infatuation became an obsession. I still am not a ‘coder’ but have written and posted a few blogs which included scripts that I found very helpful.

I was previously using PowerGUI but when I upgraded to PowerShell v3 I started having problems and did not feel like trying to figure it out since the PowerShell ISE that is included with version 3 is quite good. I was quickly able to get the hang of using the ISE to step through my scripts for debugging and logic and was quite proud of myself. I remembered seeing that Sapien was one of the sponsors of PowerShell Saturday so I decided to take a look at what they offered. I found PowerShell Studio 2012 and downloaded a trial version. I then contacted the company since Sapien is one of many companies that have partnered with Microsoft to offer products to MVPs.

Being an administrator, it took me a little while to get used to the development interface. It reminds me of  the layout that Visual Studio uses. I had been fighting with debugging a PowerShell script that requires version 2. I had tried both PowerGUI and PowerShell ISE to help debug the application so that it would run on my laptop that has version 3.0 installed. Using the –version 2 switch did not resolve the issue. Once the form was created, the application would loop until it crashed. Enter PowerShell Studio 2012 and the powerful Debug File option. I was able to use this functionality to see that specific line of code that was causing the problem. I remarked out that single line of code, and Viola my application works again. This would not be a big deal, but the guy that wrote the application does not work with me anymore so I did not want to reach out to him to ‘fix’ it for me.

Here sits a happy MVP that is loving using PowerShell Studio 2012 and learning more and more each day. Take a look at what they have to offer. I am sure you will be as happy with the product as I am.

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

Using PowerShell and WMI to change Service settings

Recently we had a situation where a service would not start on initial boot up. The service could be started manually after the server had started so it was not a problem with the service or the account that it was running under. I had already tried setting the Startup Type to be Automatic (Delayed Start) but this did not allow the service to start after a reboot. I then checked the Recovery tab for the service and saw that all options were set to Take No Action. Since one of the recovery options is Restart the Service and another is Restart the Server, I decided to look to see if there was a way to programmatically set this to remove human error from the equation. Automation is always the best way to go to ensure that the same process is repeated each time.

I want to do this in PowerShell so the snippet can be added to our build scripts. This will work for any service but I am specifically trying to set the Recovery options for the SQL Agent. I found the Get-Service cmdlet within PowerShell but was not able to set access/set/update this value within the service. I then began looking at WMI options and came across sc.exe.  I found this great blog post that addressed the exact problem I was working on. Check it out for all of the information related to the arguments in my code snippet.

Here is the snippet that I used to update this setting.

$services = Get-WMIObject win32_service  | ? {$_.name -eq “SQLSERVERAGENT” -and $_.startmode -eq “Auto”}
foreach ($service in $services){sc.exe failure $service.name reset= 86400 actions= restart/5000}

I hope this helps you if you run across the need to perform this as well.

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

IIS Troubleshooting

Recently I wrote a troubleshooting blog for work that uses a couple built-in Windows/IIS features and finally Debug Diagnostics to determine root cause of high CPU usage for a website. The referenced utilities were the Worker Processes feature of IIS, Resource Monitor, and DebugDiag. By using these 3 free utilities, you can diagnose long running pages/queries, determine if the process is waiting on a response from IIS or SQL or another external call, and possibly even find the resolution for the problem by taking a process dump and evaluating it. Check out the full blog post here.

Terri is a Microsoft MVP (ASP .NET/IIS), an MCSA: Windows Server 2012, and a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions

My niece has arrived

I seldom write blog posts that are not technical in nature but this one just has to happen. On Friday, July 12th at 5:11AM EST, my sister gave birth to Reece Alexandra Smart. This is my first niece born of my blood. She was 7 lbs 3 oz and 19 inches long. My sister has dreamed of being a mother since she was very young. I, on the other hand, have loved being an aunt for most of my adult life. I have many nieces and nephews on my husband’s side of the family and we have a great time with them. Reece lives 20 minutes from us and rather than ‘growing up’ with her, we will just be ready to spoil the pants off her and make her mom and dad regret giving us the freedom to do it. 🙂

Welcome to the world ‘littlest one’. I gave her this nickname because my sister has always been my ‘little one’. As I was leaving the hospital today I said ‘bye little one’ and Aron answered with ‘bye AuntT’. I let her know I was referring to her and hence the nickname ‘littlest one’ came about. That is kinda long. Will have to come up with a new one for Reece as she grows up.

Email configuration on Galaxy devices

Today I received a request to reach out and help one of our clients configure his device to access his OrcsWeb hosted email account. Since this is a question that comes up often, I decided to write up the directions and include screenshots for the Samsung Galaxy S3 (which is the device that I personally use). The steps to access the Add Account option may be slightly different on other Samsung Galaxy devices but the required data, i.e., POP3 and SMTP email server, will match this walkthrough. For hosted email accounts, the username is always the entire email address for the account being configured.

To begin with, you need to access your phones Settings. You can do that either via the Settings icon, if you have it on one of your screens or by accessing the menu key and selecting Settings. I did the 2nd option.

1

You will then see the Settings menu for your phone. Scroll down until you see Accounts and then the Add account option.

2

Press Add account. You will see a list of account that you can select. We are going to select Email.

3

Once you press Email, you will see the initial configuration screen to setup your new account. The account that I am going to setup is test.user@shegeekconsulting.com. Enter your email address and the password for the account on this screen. You can click Show password to ensure you typed it correctly, especially if it has special characters.

4

Next press Manual setup. We are going to setup a POP3 account.

5

Press POP3 and you will get to the Incoming server settings screen.

6

Update your username if needed to include the email domain. Your password will be copied over to this screen. Update the POP3 server to be mail.orcsweb.com. Press Next to proceed to the Outgoing server settings.

7

Update the SMTP server to mail.orcsweb.com and check the Require sign-in box. All other data will be copied from the previous screen. Click Next and configure your sync options.

8

Press Next to move to the screen to complete the mail configuration.

9

Press Done and you are ready to begin sending and receiving your emails from your OrcsWeb hosted email account.

Hopefully you will find this walkthrough useful when configuring your new Samsung Galaxy devices.

Terri is a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions.

I am a Microsoft MVP!!

Got the email today that I was awarded Microsoft MVP. It is awarded as a result of your contributions for the past year. I have been active in the iis.net forums and blogging about PowerShell and IIS. More to come later. Just wanted to share this awesome news with everyone.

Terri is a Support Specialist at OrcsWeb, a hosted server company providing managed hosting solutions.