How to Install Internet Information Services (IIS 7) on Windows 7 Ultimate

rodathome:

I had this very problem at work where I’m using Windows 7 Enterprise Edition. This was very helpful and now I’ve got IIS 7.5 running.

Originally posted on The Voice® of Srijon:

internet-information-services-iis7-manager

If you want to install Microsoft Internet Information Server (IIS 7) on your new Windows 7 computer first time after working with IIS 6 for long years, I believe you will be surprised with the improvements and changes both in IIS and IIS installation process.

First of all Microsoft has renamed the IIS as Internet Information Services and is not now using Internet Information Server for IIS.
In this short guide I will summarize the steps of installing IIS 7 on Windows 7 in the way I had recently on my Windows 7 Ultimate Edition PC. I’m using this pc as a home pc but I work on my web projects at home so I run SQL Server 2008 R2 as well as IIS and host ASP.NET applications.

So if you want to install Internet Information Services (IIS 7) for a developer computer then you can follow me by reading…

View original 680 more words

Getting the list of groups the logged in user is a member of in Active Directory

I was recently tasked with coming up with a way of listing who the currently logged in user is, and also all of the groups he/she is a member of in the domain. So I wrote a console app that should the user and the domain groups they’re a member of in an Active Directory. This is a C# application.

First I’ll give the class definition I created to hold the data. This class is called UserGroupInfo:

using System.Collections.Generic;

namespace UserGroupsConsole
{
    public class UserGroupInfo
    {
        public string Username { get; set; }
        public List<string> UsersGroups { get; set; }
    }
}

Next is the RetrieveUserInfo class. This is the one that does all of the heavy lifting. Please note that I had to add a reference to the System.DirectoryServices.AccountManagement.dll in order to make this work:

using System.Collections.Generic;
using System.DirectoryServices.AccountManagement;
using System.Security.Principal;

namespace UserGroupsConsole
{
    public static class RetrieveUserInfo
    {
        public static UserGroupInfo GetUserInfo()
        {
            UserGroupInfo ugi = new UserGroupInfo();
            ugi.UsersGroups = new List<string>();

            //this is the easy part
            string user = WindowsIdentity.GetCurrent().Name;

            if (user.IndexOf('\\') >= 0)
            {
                ugi.Username = user.Split('\\')[1];
            }
            else
            {
                ugi.Username = user;
            }

            //now get the user's AD groups, makes use of System.Security.Principal
            IdentityReferenceCollection irc = WindowsIdentity.GetCurrent().Groups;

            foreach (var item in irc)
            {
                ugi.UsersGroups.Add(GetGroupNameBySid(item.Value));
            }


            return ugi;
        }

        /*
         * Needed to add a reference to System.DirectoryServices.AccountManagement in
         * order to be able to use PrincipalContext and GroupPrincipal.
         */
        public static string GetGroupNameBySid(string sid)
        {
            PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
            GroupPrincipal group = GroupPrincipal.FindByIdentity(ctx, IdentityType.Sid, sid);

            if (group == null)
            {
                return sid;
            }

            return group.SamAccountName;
        }
    }
}

And lastly of course is the main program that runs it:

using System;

namespace UserGroupsConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            UserGroupInfo ugi = RetrieveUserInfo.GetUserInfo();

            Console.WriteLine("User Name: {0}", ugi.Username);
            Console.WriteLine("AD Groups that {0} is a member of:", ugi.Username);
            for (int i = 0; i < ugi.UsersGroups.Count; i++)
            {
                Console.WriteLine("\t{0}", ugi.UsersGroups[i]);
            }

            Console.WriteLine("\r\n\r\nPress Enter to quit");
            Console.ReadLine();
        }
    }
}

Please note the user of PrincipalContext and GroupPrincipal classes (in System.DirectoryServices.AccountManagement namespace). I needed that in order to resolve the Security Identifier (SID) value, into a user friendly name.

I wrote this using Visual Studio 2013.

ASP.NET 5 Typescript AngularJS application with a grunt production configuration

Originally posted on Software Engineering:

This article demonstrates how to implement an AngularJS application using Typescript and grunt in ASP.NET 5. The application is built using Typescript and based on this example. The application uses grunt as its task runner. The grunt task runner produces a production configuration and can also be used in a CI process on any build server.

Code: https://github.com/damienbod/AspNet5TypescriptProductionGrunt

grunt setup

The grunt is setup so that the application uses only 4 files for all its javascript and css dependencies. This could also be optimized down to 2 files if preferred. The index.html file is implemented as follows: (You can see from the file that angular and angular-ui-router is used.)

This index file uses the javacript and the css files produced in the grunt tasks.The grunt file has two main tasks: development and buildserver. The development task creates the javascript files from the typescript files using grunt-ts, then concats all…

View original 651 more words