Enable Claims Based on existing Web Application with Classic Mode (Access denied Error)

Recently i encountered a situation in which i need to enable the claim based authentication for the existing web application which has windows authentication. From the central administration there is no way or option to enable it. This can be achieved only by the powershell script. $WebAppName = “http://yourWebAppUrl”$wa = get-SPWebApplication $WebAppName$wa.UseClaimsAuthentication = $true$wa.Update() The above code will enable the claims based authentication to the existing web application. But once enabled when try to Login the user might get Access Denied Error. This is because the users are stored in the different format in the claims based authentication. Need to … Continue reading Enable Claims Based on existing Web Application with Classic Mode (Access denied Error)

Get Logged In User while Impersonate or Run as Admin

Sometimes when a program is run as Administrator, using the System.Security.Principal.WindowsIdentity.GetCurrent().Name will return always System or NT Authority\System. This happens while running the exe under windows service or by Installer class in the windows application. The below code will solve this issue. Code Snippet public static string GetParentUser(int pid)         {             string parentUserAccount = null;             string queryString = String.Format("select ParentProcessId from win32_process where ProcessId={0}", pid);             using (ManagementObjectSearcher query = new ManagementObjectSearcher(new             SelectQuery(queryString)))             {                 foreach (ManagementObject mo in query.Get())                 {                     uint parentPid = (uint)mo.Properties["ParentProcessId"].Value;                     queryString = String.Format("select Handle from win32_process where ParentProcessId = {0}", parentPid);                     using (ManagementObjectSearcher subQuery = new ManagementObjectSearcher(new                     SelectQuery(queryString))) … Continue reading Get Logged In User while Impersonate or Run as Admin

How to create bootable VHD – Windows 7 or Windows 2008 R2

Technorati Tags: Bootable VHD,Windows 7,Windows 2008   The below steps shows how to create a bootable VHD install for Windows 7 or Windows 2008 R2. With this step x64 OS can be installed, but requires a VT enabled machine in the BIOS. 1. Insert the Bootable Install DVD to the drive[Windows 7 or Windows 2008 R2] 2. Restart the machine, make sure the boot order is to DVD first in the BIOS to boot in DVD. 3. Once the windows is loaded, Select next in the Language selection screen 4. In the Install Now screen, Press Shift+F10 to enter into … Continue reading How to create bootable VHD – Windows 7 or Windows 2008 R2

How to create Win 7 Themes

Creating themes in Windows 7 is much easier. Earlier version of windows don’t have this options. We can even export the theme and send to other people for sharing. In this blog i will explain first how to create a theme from Win 7 and later will explain how to share with other people. Part – 1: How to create Theme in windows 7 Creating theme in Windows 7 is nothing but personalization of existing theme and save it with full name. Then later can export the theme to share with the people. To do that first go to the … Continue reading How to create Win 7 Themes

WMI Provider in Hyper V

Windows 2008 server has a Hyper V to manage the Multiple Virtual Machines. The Hyper V manager helps to create Virtual machine and manage them. We can change the VHD and update the path using the Hyper V Manager. There are situation we need to write a program to do those tasks. Example when we do the DR using multiple Virtual Machines, some of the VM VHD path was not mapped exacted to the correct path. The VHD path was still pointing to old server while exporting the VM. So to update the VHD path programmatically i started looking to … Continue reading WMI Provider in Hyper V

Network Profile for XP

  Currently switching between different Networks in XP is difficult. Unless we buy a thirty party tool it’s difficult to switch the profile. Here is the very simple solution to switch the profile in XP machine. Save the Network Profile to a Text File Open a DOS shell with start -> run; then type cmd On shell use the following command netsh -c interface dump > c:\MyNetwork.txt Using the above method any number of profile can be created and saved to the local machine Creating a Desktop Shortcut for the Created Profile On the Desktop Right Click New -> Shortcut. … Continue reading Network Profile for XP