Category: Windows

Tuning a Windows 7 VM

I run several Windows Virtual Machines (VMs) on my Mac with VMware Fusion. Even VMware Fusion has a great performance for Virtual Machines I am really happy about every performance increase I can get. I made a list with some tuning tips. Here is how you are tuning a Windows 7 VM.

  • First use Windows Classic Theme
  • Deactivate System Protection (You also win some Diskspace)
  • Under System Properties –> Advanced –> Performance –> Choose Adjust for best Performance
  • Deactivate Autostart objects with MSCONFIG

There are a lot of more tips out there but I think these are pretty important.



PowerShell

Powershell: Parsing XML part 1

In my company, we started to use XML files as configuration files. So we use it for some configurations of servers or automation for our robots. In Powershell, there is a pretty easy way for parsing XML. In Powershell there is an object type for XML, so you just can use the get-content Cmdlet to read the XML file into the object.

$xmldata = get-content "C:\XMLFiles\mydata.xml"

When you create a function for reading XML files you also can set the XML object to global.

$global:xmldata = get-content "C:\XMLFiles\mydata.xml"

Now $xmldata is an object which includes all the data of the mydata.xml.

Let’s view the content of the mydata.xml file. We need this to understand the following commands.

<TodoList ID = "Week21"> 
<task action="create" ID="1"> 
<name>Peter</name> 
<dept>Administration</dept> 
<email>[email protected]</email> 
</task> 
<task action="create" ID="2"> 
<name>Thomas</name> 
<dept>Administration</dept> 
<email>[email protected]</email> 
</task> 
<task action="delete" ID="3"> 
<name>Steve</name> 
<dept>IT</dept> 
<email>[email protected]</email> 
</task>

Now we wanna get all unique Accounts listed

$xmldata.TodoList.Task | %{$_.Name} | select-object -unique
Peter
Thomas
Stefan

We can also create a new object for a specific Task

[Object]$xmltask2 = $xmldata.TodoList.Task | Where-Object {$_.ID -eq "2"}

Now we have a new object with data from Task ID 2. If we wanna see the name from this we just use the same command with the new object

$xmltask3 | {$_.Name}
Thomas

We can do a lot more with this, but I will bring this up in the next blog posts.



Cheatsheet: Using Diskpart on a Server Core installation #4

Using Diskpart on a Server Core installation. Disk Administration or Partition a disk.

Create a new partition and format a partition

SELECT DISK 0
CREATE PARTITION PRIMARY
ASSIGN LETTER=E
SELECT PARTITION 1
FORMAT FS=NTFS LABEL="New Volume" QUICK
EXIT

Commands you may then issue at the DISKPART prompt:

LIST Disk
LIST Partition
LIST Volume

SELECT Disk n
SELECT Volume n
SELECT Partition n

DETAIL Disk
DETAIL Partition
DETAIL volume

HELP
REM (remark/comment)
EXIT

Commands to Manage Basic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

CREATE PARTITION Primary Size=50000 (50 GB)
CREATE PARTITION Extended Size=25000
CREATE PARTITION logical Size=25000

DELETE Partition

EXTEND Size=10000

REMOVE letter=l (Remove drive letter l from the in-focus partition)
REMOVE /ALL (Remove ALL current drive letters and mount points)

Commands to Manage Dynamic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

ADD disk=n (Add a mirror to the in-focus SIMPLE volume on the specified disk.)

BREAK disk=n (Break the current in-focus mirror)

CREATE VOLUME Simple Size=n Disk=n
CREATE VOLUME Stripe Size=n Disk=n,n,...
CREATE VOLUME Raid Size=n Disk=n,n,...

DELETE DISK
DELETE PARTITION
DELETE VOLUME

EXTEND disk=n [Size=n]
IMPORT
ONLINE

REMOVE letter=l (Remove drive letter l from the in-focus volume)
REMOVE /ALL (Remove ALL current drive letters and mount points)
RETAIN

Commands to Convert Disks:

CONVERT mbr
CONVERT gpt
CONVERT dynamic
CONVERT basic

CLEAN ALL (remove all partition and volume info from the hard drive)
RESCAN



Cheatsheet: How to install HP Support Pack on a Server Core installation #3

This is a HowTo step-by-step guide to install the HP Support Pack on a Windows Server 2008 R2 Core installation or Hyper-v Core installation.

  1. Download the latest HP ProLiant Support Pack for Windows Server 2008 R2
  2. Eable SNMP on Windows Server 2008 R2 Core by typing start /w ocsetup SNMP-SC
  3. Extract the HP ProLiant Support Pack on a Management Machine to C:\Supportpack
    Extract HP ProLiant Support Pack
  4. Connect to the Remote Windows Server Core for example \\hyperv01\c$
    Connect to Core Server
  5. Create the folder C:\hp on the Remote Core Server
  6. Copy the files from C:\supportpack to \\hyperv01\c$\hp
    Copy HP ProLiant Support Pack
  7. On the Core Server execute C:\hp\hpsum.exe
    execute hpsum.exe
  8. Install the HP Supportpack as usual
    HP Smart Update ManagerHP Smart Update ManagerHP Smart Update ManagerHP Smart Update Manager
  9. Reboot the Server


Cheatsheet: Add roles and features to a Server Core installation #2

This are some commands to add roles and features to a Windows Server 2008 R2 Core installation.

You also can enable Remote MMC and Remote Server Manager to simply connect from a management server to the core server and add roles with GUI. This may only work within a domain environment. You can enable remote management pretty easy with the sconfig.cmd. Find out more about configuring Windows Server 2008 R2 Core installations here.

List available server roles and features:

oclist

Install, uninstall and configure Active Directory Domain Service role:

dcpromo

Help for dcpromo:

PS C:\> dcpromo /?

Command line parameters include:

/unattend[:filename] Used to specify the unattend operation mode or supply an unattended install script file.

/adv
Enables advanced user options.

/uninstallBinaries
Used to uninstall Active Directory Domain Services binaries.

/?[:{Promotion | CreateDcAccount | UseExistingAccount | Demotion}]

/?:Promotion, /?:CreateDCAccount, /?:UseExistingAccount, and /?:Demotion
will display unattend parameters applicable to the specified task. /CreateDCAccount and /UseExistingAccount:Attach are mutually exclusive.

/CreateDCAccount
Creates an RODC account.

/UseExistingAccount:Attach
Attaches the server to an RODC account.

/forceRemoval
Forcefully uninstalls Active Directory Domain Services on this domain controller. The account for the domain controller will not be deleted in the directory, and changes that have occurred on this domain controller since it last replicated with a partner will be lost.

/?
Will display this help.

Unattend parameters can also be specified on the command-line. For example:

dcpromo.exe /ReplicaOrNewDomain:Replica

Press any key to quit ...

Install a role or feature its basically always the same:

start /w ocsetup <roleorfeature>

start /w ocsetup DNS-Server-Core-Role

Uninstall a role or feature:

start /w ocsetup <roleorfeature> /uninstall

start /w ocsetup DNS-Server-Core-Role /uninstall

Install SNMP feature:

start /w ocsetup SNMP-SC

Install Microsoft Hyper-v role:

start /w ocsetup Microsoft-Hyper-V



How to create a Windows 7 & Windows Server 2008 R2 Install USB Stick

Its very simple to create a Windows 7 or Windows Server 2008 R2 bootable USB Stick. Microsoft provides a tool called Windows 7 USB/DVD Tool. This tool also works for Windows Server 2008 R2.

  1. Download Windows 7 USB/DVD Tool and install it
  2. Start the programm and choose the .iso Image (Windows 7 or Windows Server 2008 R2)
    Windows 7 USB/DVD Tool
  3. Choose which media you want to create (USB)
    Windows 7 USB/DVD Tool
  4. Choose USB device
    Windows 7 USB/DVD Tool
  5. Begin Copying and after some minutes your USB Stick is ready to use


The Bing Bang Theory: Windows 7 is much more userfriendly than Windows Vista

Windows 7 is much more user-friendly than Windows Vista. I don’t like that. – The Big Bang Theory

The Big Bang Theory: Windows 7 is much more userfriendly than Windows Vista



Microsoft Windows 7 with Windows XP Mode and Windows Virtual PC

Great news for small businesses. The Windows 7 Pro and Ultimate Edition delivers a new Feature called Windows XP Mode or XPM. Basically, its a Windows XP running in a Virtual Machine on Virtual PC. Which allows Users to run Windows XP Applications (or business applications which are not compatible with Windows Vista/7) on Windows 7.

Windows Team Blog: Coming Soon: Windows XP Mode and Windows Virtual PC:

Windows XP Mode is specifically designed to help small businesses move to Windows 7. Windows XP Mode provides you with the flexibility to run many older productivity applications on a Windows 7 based PC.

All you need to do is to install suitable applications directly in Windows XP Mode which is a virtual Windows XP environment running under Windows Virtual PC. The applications will be published to the Windows 7 desktop and then you can run them directly from Windows 7.

Windows XP Mode and Windows Virtual PC are best experienced on your new Windows 7 PC. We will be soon releasing the beta of Windows XP Mode and Windows Virtual PC for Windows 7 Professional and Windows 7 Ultimate.