Windows Server 2008 R2 & Windows 7 Clear Up winsrx folder

 

After a period of time Windows operating systems begin to fill the disk space on the system drive… this is because of all the Windows Updates that you should be applying… The WinSRX folder lives inside the Windows folder on the root drive…. One of the steps to clear out the temporary Windows update files is to run the following command in an elevated command prompt:

DISM /online /Cleanup-Image /SpSuperseded
image

Install and Configure Windows PowerShell Web Access in Three Easy Steps

 

Windows PowerShell Web Access Gateway Architecture



Windows PowerShell Web Access is a new feature in Windows Server 2012. It is an IIS application that provides a Windows PowerShell console in a web browser. The IIS application acts as a gateway between the web browser and the machines that you can connect to in your environment. These machines should have Windows PowerShell remoting enabled.

The following is all done from an elevated PowerShell window of the Windows 2012 server you want to install PWA on.


1. Import the Server Manager PowerShell module and install the Windows PowerShell Web Access feature


Import-Module ServerManager

Install-WindowsFeature -Name WindowsPowerShellWebAccess -IncludeManagementTools


2. Install the Web Application in IIS


Install-PswaWebApplication [-UseTestCertificate]

Add the -UseTestCertificate parameter if you don’t already have an SSL certificate installed on the server. This will install a self-signed SSL certificate that will expire in 90 days.


To use an existing SSL certificate, make sure it is configured in Bindings on the Website to use that certificate.



3. Configure Authorisation Rules


Add-PswaAuthorizationRule -UserName domain\username -ComputerName * -ConfigurationName *

This Authorisation Rule will allow the specified account to connect to any computer with any configuration name.

If you are installing on a workgroup server substitute the computer name for domain.


That’s all there is to it!

You can access Windows PowerShell Web Access from Internet Explore using the following URL: https://servername/pswa

Windows PowerShell Web Access Login

Enter your user name, password, and the computer name you want to connect to and then click Sign In.

Windows PowerShell Web Access

A Windows PowerShell window will open in your IE browser, connected to the computer you targeted.

As mentioned above, the target computer must have Windows PowerShell remoting enabled. You can do this by running the following command from an elevated PowerShell prompt:

Enable-PSRemoting -Force


How to Convert Hyper-V VHD Disks to VHDX

Windows Server 2012 Hyper-V offers a new virtual disk type called VHDX. VHDX virtual disks have many benefits, including larger maximum disks up to 64TB, protection against data corruption, and improved alignment of the virtual hard disk format to work well on large sector disks. Seehttp://technet.microsoft.com/en-us/library/hh831446.aspx for more information about the VHDX disk type.


You can convert existing older format VHD disks to the new VHDX format using the Hyper-V Manager console. This process will create a new VHDX disk and copy the data from the existing VHD to the new disk. At the end of the procedure you will have two disks, the original VHD disk and a new VHDX disk with the same contents. You can safely delete the original VHD disk once you have confirmed that the new VHDX disk is fully functional.


Here are the steps to convert an existing VHD disk to a VHDX disk:

  • Shut down the VM that is accessing the disk, if necessary. You cannot convert a disk that is in use.
  • Open the Hyper-V VM settings, navigate to the hard drive you wish to convert, and click the Edit button, as shown below:
  • The Edit Virtual Hard Disk Wizard will start. Select Convert from the Choose Action page and click Next.
  • Select the VHDX disk format and click Next.
  • Choose whether the new disk should be fixed size or dynamicallyexpanding. Note that this gives you the opportunity to change disk types from the previous disk type. Click Next.
  • Select the name and location for the new VHDX disk and click Next.
  • Review the summary and click Finish to create the new disk. This may take a few minutes depending on the size of the VHD and the speed of your hard drive(s). The size of the new VHDX disk will be slightly larger than the original VHD disk.


  • The last step is to mount the new VHDX disk to the Hyper-V VM. Note the new VHDX extension.

Once you have started up your VM with the new VHDX disk you can safely delete the old VHD disk.

 

PowerShell Script to Identify Computer Accounts That Have Not Been Used For A While

 

Working for an IT Company, providing a support service we have to keep on top of day to day admin tasks, one of these tasks is keeping Active Directory in order. This task can become more difficult as time goes by, as I am sure I am not the only one who does not keep AD up to date when removing PC’s and Servers from the domain… below is a handy little PowerShell script that I put together that will output any PC / Server that has not logged on for 60 days or more:

$ErrorActionPreference=”SilentlyContinue”
Stop-Transcript | out-null
$ErrorActionPreference = “Continue”
Start-Transcript -path C:\output.txt -append
$maxOldLogonDays = 60
$adsiSearcher = new-object DirectoryServices.DirectorySearcher(“LDAP://rootdse”)
$adsiSearcher.filter = “objectCategory=Computer”
$adsiSearcher.findall() |
Foreach-Object `
{
“Processing $($_.path)”
$rawLogon = $_.properties.item(“lastlogon”)
$convertedLogOn = [datetime]::FromFileTime([int64]::Parse($rawLogon))
If( ((get-date) – $convertedLogOn).days  -ge $maxOldLogonDays )
  {
    “$($_.properties.item(‘distinguishedName’))
     has not logged on for more than  $maxOldLogonDays days”
  } #end if
} #end foreach
Stop-Transcript

All you need to do is copy and paste the above text to a notepad file and save it as a .PS1 (powershell commandlet format)

VMware Changing the thick or thin provisioning of a virtual disk

This article provides steps to change the provisioning of a virtual disk from thick to thin, or from thin to thick. The procedure uses the vSphere Client and vCenter Server to perform this task

To change the provisioning of a virtual machine base disk from thin to thick from the Datastore Browser:

  1. Power off the virtual machine.
  2. In the vSphere Client, select the virtual machine in the inventory.
  3. Click Edit Settings to display the Virtual Machine Properties dialog box.
  4. Click the Hardware tab and select the appropriate hard disk in the Hardware list. The Disk Provisioning section on the right shows the type of your virtual disk, either Thin or Thick.
  5. Click the Summary tab.
  6. Under Resources, double-click the datastore where the virtual machine resides to open the Datastore Browser dialog box.
  7. Click the virtual machine folder to find the virtual disk file you want to convert. The file has the .vmdk extension.
  8. Right-click the VMDK file, and click Inflate. The Inflate option converts the disk to thick provisioned.

Notes:

  • If the Inflate option is grayed out, this may indicate that the virtual machine is not powered off or that it is not thin provisioned.
  • There should be no snapshots and the conversion is performed on the base disk.

To convert a virtual machine base disk from thick to thin provisioning by changing the datastore and using offline virtual machine migration:

  1. Power off the virtual machine.
  2. Right-click the virtual machine, and click Migrate.
  3. Click Change datastore.
  4. Click Next, and select a datastore that is not the same as the current datastore.
  5. From the dropdown, select the Thin Provision virtual disk format.
  6. Click Next, then Finish.

Microsoft Server 2008 R2 – Server Wont Boot – Recovery Console

 

One of our customers had a power cut, and the UPS did not save the day…. we could not get the server up and running again as all it wanted to do was to load the recovery console.

The only way to resolve the problem was to perform the following commands loading the command prompt from the recovery console.

Browse to E:\Windows\System32\config\RegBack copy the “System” and Paste to E:\Windows\System32\config

copy system.* to c:\windows\system32\config

*** Remember when you are in the recovery console the C drive is not the original C drive of the server it will be D or E drive depending on your disk layout ***

Installing VMWare ESXi 5.1.0 On Dell Hardware

 

While installing ESXi 5.1.0 (making use of VMware native Image), you might observe ‘No network adapters were detected’ error message.

The reason for this is because the VMware native ESXi 5.1.0 image does not contain the required version(s) of network drivers for Network Daughter Cards (NDC) or Network adapters used in Dell 12G Servers.

You need to make use of the Dell Customized ESXi 5.1.0 Image posted at support.dell.com, which contains the required network drivers for all NDC’s and Network adapters used in Dell 12G Servers.

NOTE: Follow the steps listed in Downloading Dell Customized ESXi image for downloading Dell Customized Installer Image

Upgrading VMWare ESXi 5.0.0 to ESXi 5.1.0

Upgrade using ISO Disk Image

  • Select ESXi5.1.0-799733-Standard Installer

  • Select the Storage device on which the installation has to be upgraded

  • Select Upgrade ESXi, Preserve VMFS datastore

  • Press F11 to proceed with the upgrade

  • Enter to reboot after the upgrade has been completed. Please make sure to remove the installation DVD/CD and BIOS has been altered to change the boot order adjust it accordingly

Ta Da!!! you are now running VMWare ESXi 5.1.0 on your host

 

VMWare 5.1.0 Important Considerations for Upgrading:

http://longwhiteclouds.com/2012/09/12/vsphere-5-1-generally-available-important-upgrade-considerations/

Running Hyper-V on Windows Server 2012 from VMware Workstation 8

 

So the scenario is that I have an instance of Windows Server 2012 running on VMware Workstation 8 on my laptop (Windows 8).

Adding Hyper V role to the server

Speed bump

The other error that has been recorded:

Fix:

Shutdown the Windows Server 2012

Browse to your VM location and open the vmx file and append at the end the following two lines

1 hypervisor.cpuid.v0 = “FALSE”

1 mce.enable = “TRUE”

Save and power up your VM

Let’s try that again

Now you should be able to go on and configure your Hyper- V role on the server.