Showing posts with label Windows 2008 R2. Show all posts
Showing posts with label Windows 2008 R2. Show all posts

Tuesday, August 14, 2018

Enable Disk Clean-up

It seems in Windows Server latest versions the good old disk clean up tool is not enabled by default. If you just want it back you can run the below commands in a command prompt to copy the required files.

Copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe C:\Windows\System32\

Copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui C:\Windows\System32\en-US\

Then create a shortcut pointing to the Disk Clean up tool found in the following path.

C:\Windows\System32\CleanMgr.exe

I did try this on Windows Server 2008 R2 and hope it works as it is or with slight changes on other versions of Windows as well.

Tuesday, June 20, 2017

Enabling .NET 3.x on Windows 8 and Up

As you may be knowing, now you do not need to separately download and install .Net framework as we used to do with the older .Net frameworks. Since it is coming with Windows, you can just go to “Turn Windows Features On or Off” screen and enable framework you are after. It is simple right?

But in one of the machines it was not that simple for me. The installation tried to download files from Windows Update and was failing mentioning that it cannot get connected to Windows Update when the machine is connected to the internet without any issues.

The solution is to use DISM (Deployment Image Servicing and Management) tool to get it installed.

First you need to find a Windows setup media, a setup DVD or an ISO downloaded will work.

Then use the below command to enable the feature using a local source. Remember to open the Command Window as an Administrator of the machine.

DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\Sources\sxs

/Online – Targets the currently active and running OS.

/LimitAccess – If some installation files are missing, this will check Windows Update for the missing files. For not to check use /LimitAccess:True.

/Source – Is the location to find the source files, E: is my virtual drive which I mounted the previously downloaded Windows ISO.

If typed correctly, there will be a progress bar showing the installation progress.

image

Sunday, March 26, 2017

Removing all Partitions from a Disk

Today I thought of writing an article on how to remove all the partitions from a disk so you can re-use the disk.

If you tried removing existing partitions using the Computer Management (type computer management on the start menu to open it) tool in Windows you will find that, you can delete partitions by right clicking on the partition / volume and clicking on Delete Volume option.

image

However you will notice Computer Management is useless on some of the protected volumes since the options to work on them will not be available.In this case you will need to use the DiskPart utility in the Command Prompt.

image

In the Start type Cmd or Command Prompt to open a command prompt. Then type DiskPart, it is a powerful utility which can even work on protected volumes.

In my case, I would like to work on Disk 3 to remove all the existing volumes on it. Below are the steps required to clean the drive.

1. Select the disk.

List all the disks by typing List Disk, this will list all the disks connected and active at the time in your computer including the disks connected via USB ports.

image

Once you identify the disk you need, selection can be made by using the command Select Disk x. In my case Select Disk 3.

To confirm, list all the partitions on the selected list by using the command List Partition.

image

2. Delete all partitions by using the Clean command.

Ensure the proper disk is selected by Listing all disks by command List Disk, the currently focused disk will have a star at the beginning since recovering disks is not easy.

Type Clean and press enter. This will remove all the partitions from the disk. You can check the results by re issuing the List Partition command.

image

Close the DiskPart tool by entering the command Exit.

Computer Management will now show that the disk is uninitialized as below, Initialize the disk and create partitions / volumes as necessary to use it again.

image

Removing a Partition from a Disk

You can remove simple partitions by using the Computer Management tool found in Windows. Search for it on the Start menu to launch it.

But if it is a protected partition you will need to use the tool DiskPart. In the Start menu type Cmd or Command Prompt to open a command prompt. Then type DiskPart, it is a powerful utility which can even work on protected volumes.

To delete one partition, follow the steps.

1. List all disks by using the command List Disk.

2. Select the disk by using Select Disk x command.

3. You can confirm the disk by listing all the partitions on it by using the command List Partition.

4. Select the partition by using the command, Select Partition x command.

5. Delete the partition by command Delete Partition Override.

Override parameter needs to be passed if the partition is not a simple data partition.

You can confirm the deletion by re-listing the partitions on the disk by List Partition command.

image_thumb[15]

Monday, December 26, 2016

Open Live Writer – Plugin Not Working

While trying to setup and use the Code Plugin by Rich Hewlett I had trouble getting the plugin loaded into Live Writer. I did add the registry entry required as mentioned in the site, but still the plugin did not load.

Registry

Location - HKEY_CURRENT_USER\SOFTWARE\OpenLiveWriter\PluginAssemblies

Key - SyntaxHighlight_WordPressCom_OLWPlugIn

Value - C:\Users\Arjuna\AppData\Local\OpenLiveWriter\Plugins\SyntaxHighlight_WordPressCom_OLWPlugIn.dll

After a while I figured out that, when loading the plugin Live Writer encounters the following error.

"System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Arjuna\AppData\Local\OpenLiveWriter\Plugins\SyntaxHighlight_WordPressCom_OLWPlugIn.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Arjuna\AppData\Local\OpenLiveWriter\Plugins\SyntaxHighlight_WordPressCom_OLWPlugIn.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

This is due to a security feature of .Net Framework 4 or later. Before framework 4, if a DLL is downloaded (which is created in another computer), they used to run in full trust in the zone the assembly is running, but with frameworks 4 and later, downloaded DLLs will not run by default. To make them run, simply grant the DLL full access by going to file properties and selecting the Unblock checkbox in the security section as seen in the below image. This will apply to any plugin you download from internet. Also keep in mind to do this to DLLs you trust safe. Otherwise your computer will be unsafe.

image

To troubleshoot plugin and other errors you can refer to Open Live Writer log file located in C:\Users\Arjuna\AppData\Local\OpenLiveWriter\Open Live Writer.log.

Wednesday, August 01, 2012

HTTP Error 500.19 – Internal Server Error

Recently in one of my machines I got the above HTTP error when running an application hosted on IIS 7. The detailed error was as below.

IIS Error

“This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".”

After doing some troubleshooting I was managed to get this error fixed by reinstalling ASP.Net by running the aspnet_regiis –ir command.

For more information on running the command please refer to my old article Unable to start debugging on the web server.

Thursday, January 27, 2011

How to Allow Simple Passwords for Domain Users

Even though it is always better to use complex passwords, you may get a requirement to allow users to have simple passwords. To allow domain users to use simple passwords you need to modify the domain policy. In my following post I am using a Windows 2008 R2 machine.

1. Start Group Policy Management by clicking Start –> Administrative Tools –> Group Policy Management in your domain server or type gpmc.msc on the run window.

image

2. In the group policy management expand the forest node and then the domain node. By then you will see the domains available. Expand the domain you want the setting changed and right click on the Default Domain Policy item and select Edit. This will bring the Group Policy Management Editor.

image_thumb[16]

3. In the Group Policy Management Editor find the policy ‘Password must meet complexity requirements.’ by expanding Computer Configuration –> Policies –> Windows Settings –> Security Settings –> Account Policies and selecting Password Policy. Then right click and get the properties of the policy.

image_thumb[12]

4. To disable complex passwords select the Disabled radio button and click Apply.

image

5. To check whether the setting is really applied you can close the Group Policy Management Editor and check the settings tab at Group Policy Management.

image

Sunday, August 08, 2010

Installing and Uninstalling Internet Explorer 8

Since Internet Explorer (IE) 8 is a built-in feature of Windows Server 2008 R2 there is no way to install or uninstall it using the user interfaces. Instead you need to run the following commands in a command prompt window which has administrative privileges.

If you are only having IE in your machine as an internet browser be sure to install another internet browser before uninstalling IE, otherwise you will not be able to browse internet.

  1. Click the start button and type Cmd in the search box.
  2. Right click on the Cmd icon and click on Run as Administrator.
  3. Choose the appropriate command from below for your need and copy it.

To Install -

dism /online /Enable-Feature /FeatureName:Internet-Explorer-Optional-amd64

To Uninstall -

dism /online /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64

or

FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-8*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart"

  1. Paste the command into the command prompt windows you just opened by right clicking and clicking on Paste.
  2. Press enter to run the command, when the command is successful you need to restart your machine to complete the action.

Saturday, June 05, 2010

Enable Hibernation and Sleep in Windows Server 2008 R2

Normally when you install Hyper-V role in your server, it will disable sleep and hibernate facilities provided by Windows.

But you can avoid this by doing some alterations to Windows.

Hibernate and seep features are disabled when the Hyper-V service is started, so you can regain hibernate and sleep by changing the start parameter of the Hyper-V service (hvboot).

To change,

1. Open the registry editor by typing “regedit” in the run window.

Locate the key,

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\hvboot and then set the start value of it to 3.

Start property can hold the following values.

0

Boot (Not supported by hvboot.)

1

System

2

Auto

3

On Demand

4

Disabled

Now you will have the hibernate and sleep facilities until you start the Hyper-V services in your machine.
2. Type the following command in a command prompt window with administrative rights.
sc config hvboot start= demand
Note that there needs to be a space between the = sign and the word demand.

Enabling Hibernate in Windows

Some server versions of Windows are having the hibernate feature disabled by default. So if you need to change the hibernation do the following simple steps.

1. Click start and type “cmd” or type command in the search box.

2. Then in the search results, right click the Command Prompt and click on Run as Administrator.

3. If you are prompted by the user account control click continue.

4. Then,

To turn hibernation on in your machine type -

powercfg.exe /h on” or “powercfg.exe /hibernate on

To turn hibernation off in your machine type -

powercfg.exe /h off” or “powercfg.exe /hibernate off

5. Lastly you can exit the command prompt by typing “exit”.

 

Sometimes you might get an error similar to the following while trying to enable hibernation.

Hibernation failed with the following error: The request is not supported.

The following items are preventing hibernation on this system.
        An internal system component has disabled hibernation.

 

This means your machine is running roles or services that are disabling hibernation feature. One such a role is Hyper-V. If your version of Windows 2008 is running Hyper-V then you cannot enable hibernation. This is not an error but is deliberately done since hibernating a server running virtual machines is a very complicated and rarely requiring service in an enterprise server.

But there is a way to enable hibernation on a Hyper-V installed machine, which you will be able to find in my next article.

Saturday, May 29, 2010

How to Make a Bootable Flash Drive

Recently I installed Windows using a flash (Pen/Thumb) drive, since I couldn’t get hold of a blank DVD to burn the ISO into.

It might be helpful to you as well. Because we don’t need to burn DVDs to install OSs that are coming as ISOs anymore.

Follow the steps below.

1. Find a good USB Flash drive with required space.

Make sure you have backed up all the required data in the flash drive because the flash drive will be formatted.

2. Get a command prompt by typing “cmd” in the run window.

3. Type “diskpart” and press enter.

This will open up a new window for DiskPart utility, you need to use the following commands within the diskpart utility to make the flash drive bootable.

4. In the diskpart utility select the flash drive by typing “select disk 2”.

Use extra caution when selecting the flash disk since if you select the wrong disk you will loose all data of that disk. You can use “list disk” command within the diskpart utility to list all the disks attached to your computer. Note the disk referred here is a physical disk attached to the computer not a partition.

5. Clean the disk by using the command “clean”.

6. Create a primary partition inside the flash drive by typing in “create partition primary”.

7. Select the newly created partition by using command "select partition 1”.

8. Make the selected partition active by typing in the command “active”.

9. Then you need to format the partition by using the command “format fs=fat32” inside the diskpart.

Note that we are formatting the disk using FAT32 file system.

10. Use the command “assign” to assign a drive letter for the newly formatted drive, since we are not giving a drive letter it will get the next available drive letter automatically. Then exit the diskpart utility by typing in “exit”.

11. Now we need to copy the setup files to the flash drive.

For this we can use the good old xcopy command as of below.

xcopy F:\*.* /s/e/f G:\

In the above command I am coping the contents of the drive F (which is a virtual drive created by Power ISO) to drive G which is the flash drive I created.

The meanings of the flags I used are as follows.

“xcopy F:\*.* /s/e/f G:\”

F:\ – Source Drive

*.* – All Contents

/s – Copies directories and sub directories which are not empty

/e – This will add the empty directories also so now all the directories and sub directories will be copied even though they are empty

/f  – Will show the source and destination file names while copying.

G:\ – Destination Drive

When xcopy completes you will have a flash drive which you can boot your computer, in my case I had a Windows 2008 R2 installer. You may even be able to copy the OS files to your flash drive and boot an OS with this method.

Then you may need to change your BIOS options and/or press function keys to let you boot from the flash drive.

Sunday, April 18, 2010

Windows Update Error

Today I faced an error when trying to install few updates for Windows. The message Windows was showing was “Windows update encountered an unknown error.”. So it was not helpful in resolving the issue.

This is happening due to either update not getting downloaded properly, getting corrupt while downloading, space issues in your hard disk, errors while applying updates, etc.

To my satisfaction one thing I did, fixed the issue. If you are also getting similar error I recommend you to first browse to your SoftwareDistribution folder inside Windows installation folder. For example I found it in “C:\Windows\SoftwareDistribution”.

Then delete all the folders in the folder (make sure the Windows Update is closed before doing this) and restart your computer.

After making sure your Windows installation partition is having enough free space (about 1 GB) try running Windows Update again. This time the updates will get installed successfully.

Monday, November 30, 2009

Open a Port in Windows Firewall

If you tried to open a port in Windows Firewall which comes with Windows Server 2008 R2 you will find that Microsoft had given Windows Firewall a new look and feel.

At first you may feel that you are lost with the new interface, so thought to show how to open a port.

I will be creating an inbound rule opening the port 1443, which normally SQL Server is using for communications (Yes this machine is having SQL Server installed).

Go to Start -> Control Panel -> Windows Firewall.

Click Advance Settings from the left pane to bring up the Windows Firewall main screen.

Click on Inbound Rules and then right click on the same. If you only right click on this you will only see the options Refresh and Help. First click on it and then right click, now click on New Rule ….

This will bring the New Inbound Rule Wizard.

Select Port since we are going to open a port, if you need to open an application you can select the Program radio button, to create a rule based on an existing rule use Predefined radio button, use Custom to create a custom rule. Press Next to proceed.

Make sure TCP is selected and type in 1433 in the Specific local ports textbox then press Next.

Select the Allow Connection action and press next.Select all the available profiles, since I need this rule applicable to all the profiles. Otherwise you can select only the ones you need. Then click Next.

Give a name for the rule and click Finish.

This will add your rule to the firewall.