Windows Virtual PC : Attach a floppy drive (VFD)
Windows Virtual PC by default does not support to add a Virtual Floppy drive. This feature has been removed from the GUI and hidden from general public. Windows Virtual PC still allows you to attach and work with VFD files but now you need to complete some steps from Command Prompt before your can work with them.
Example of the my “Windows XP Mode” virtual machine settings. As you can see no floppy.
Microsoft guys created a script which still allows you to attach a VFD file, but you still need to create a VFD file from scratch before you can continue. Download the Floppy Drive Scripts.zip.
C:\Scripts\vm>cscript FloppyDrive.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Missing command-line argument
Usage: FloppyDrive.vbs /vm:"Name of virtual machine to be started"
/action:info – to display information about the current floppy configuration
disconnect – to disconnect any attached floppy disk or floppy disk image
vfd – to attach a virtual floppy disk image
physical – to attach a physical floppy disk
/floppy:name – where name is either the full name and path for a virtual
floppy disk or the letter of a physical disk to attach
After running FloppyDrive.vbs you see that there a action to attach a vfd file. After providing right parameters I got the following message:
cscript FloppyDrive.vbs /vm:"Windows XP Mode" /action:vfd /floppy:"C:\mklinks\floppy.vfd"
Attaching C:\mklinks\floppy.vfd to the floppy drive.
C:\Scripts\vm\FloppyDrive.vbs(113, 3) (null): The system cannot find the file specified
The script does not create my floppy drive and therefore I installed the WinImage tool.
Create new file and save the file as floppy.vfd.
Now a re-run my FloppyDirve.vbs script and the file was attached.
If I open the VMC file now I can see my virtual floppy has been added to the configuration. Without the VB script this can be added manually and will perform same actions as the script.
<floppy id="0">
<pathname>
<absolute type="string">C:\mklinks\floppy.vfd</absolute>
<relative type="string">..\..\..\..\..\..\..\mklinks\floppy.vfd</relative>
</pathname>
</floppy>
Windows 7: Create a directory symbolic link to a network share
Mklink allows you to create symbolic link to a directory or a file. This was a long-waited feature for Windows and available on unix/linux based systems.
Windows Vista introduced this new feature and with Windows 7 we can utilize this now in more depth with the libraries.
Make sure you started a evaluated command prompt otherwise you will get the following message:
You do not have sufficient privilege to perform this operation.
How to start evaluated command prompt (cmd.exe)?
- Click the Start button
- In the search box, type cmd
- Hold CRTL and SHIFT; in the list of results, click cmd
- UAC will kick and click Yes
The preparation is done now.
I want to create a directory symbolic link to a network share located on \\IP\Share.
How to create a directory symbolic link to a network share?
- mklink local_dir \\ip or servername\sharename /d
Before we can continue we need to connect to the IPC$ share otherwise the action will fail. The share is located on the NAS without guest permissions.
Windows XP: Change default Keyboard layout during Log on to Windows
I am creating a virtual machine which was installed in a German OU. This OU has German settings for location and keyboard layout. I want to change the default keyboard layout from German to English.
Example:
To do that, login as Administrator and start RegEdit.exe. Browse than to:
HKEY_USERS\.DEFAULT\Keyboard Layout\Preload
Change REG_SZ names 1 to the Keyboard layout you need. I needed to have this Default in English (EN) instead of German (DE).
"1"="00000407" ==> English
"2"="00000409" ==> German
After the Preload setting has been changed I logged off and saw that new setting was applied.
Server Deployment: Autounattend.xml Windows Server 2008 R2
Windows Setup allows you to provide an answer file for a unattended install. Windows 2000/Windows XP had the winnt.sif but Windows Vista, Windows 7 and Windows Server 2008 allow you to provide a Autounattend.xml file. If you follow the right steps with SIM (Windows System Image Manager) and add the components the setup needs you can build a file which perform a automatic installation without any input during the setup phase.
Well I build such a Autounattend.xml file I run into the problem when the Windows Setup started I needed to choose which version of Windows Server 2008 R2 I wanted to install. This step I wanted to skip and really have automatic installation. To make that happen you need to add InstallFrom into the XML file.
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows Server 2008 R2 SERVERSTANDARD</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>
Make sure you query the WIM file with imagex.exe /info d:\sources\install.wim and insert that for MetaData Value (marked in RED).
Exchange 2007: How to export mailbox with management shell?
After releasing Exchange Server Service Pack 1 (SP1) Microsoft added new functionality called Export-Mailbox cmdlet for Exchange Management Shell.
The Export-Mailbox cmdlet exports all message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents. However, the Export-Mailbox cmdlet does not export rules.
To export data from a .pst file, you must run the Export-Mailbox cmdlet from a 32-bit computer that has the 32-bit version of the Exchange management tools and Outlook 2003 Service Pack 2 (SP2) or Outlook 2007 installed.
Well all prerequisites were in place; I opened the Exchange Management Shell and run the following command line:
[PS] C:\Documents and Settings\admin>Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst
Confirm
Are you sure you want to perform this action?
Exporting mailbox content from the mailbox ‘Gaag, van der Rob’ into .pst file ‘c:\gaagr.pst’. This operation may take a long time to
complete.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Export-Mailbox : Error was found for User1 (user1(at)networknet.nl) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error:
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164
At line:1 char:15
+ Export-Mailbox <<<< -identity user1 -PSTFolderPath c:\user1.pst
+ CategoryInfo : InvalidOperation: (0:Int32) [Export-Mailbox], RecipientTaskException
+ FullyQualifiedErrorId : DFCFF30D,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox
The export failed. After reading some posts on Google I found the solution myself. I tried to export my own mailbox which worked fine so the problem has to be within the permissions set. To get full access run the Add-MailboxPermissions cmdlet.
Add-MailboxPermission -identity user1 -Accessrights FULLACCESS -User admin
Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst
With these steps I can develop a procedure to backup mailboxes when they are removed from the system.
Exchange 2007: unexpected error with management shell
I received the following error message when opening and running a cmdlet with my Exchange Management Shell:
[PS] C:\Documents and Settings\admin>Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst
WARNING: An unexpected error has occurred and debug information is being generated: Unable to determine the installed file version
from the registry key ‘Software\Microsoft\Exchange\Setup’.
Export-Mailbox : Unable to determine the installed file version from the registry key ‘Software\Microsoft\Exchange\Setup’.
At line:1 char:15
+ Export-Mailbox <<<< -identity user1 -PSTFolderPath c:\user1.pst
+ CategoryInfo : NotSpecified: (:) [Export-Mailbox], TaskException
+ FullyQualifiedErrorId : Microsoft.Exchange.Configuration.Tasks.TaskException,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox
Just looking on the error message it seems that something was missing in the Windows Registry. I opened Registry Editor and browsed to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange. The Setup key was missing. Exchange 2007 management tools were installed to another server than Exchange Server was installed. I logged on the Exchange 2007 server, opened Registry Editor and browsed to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange key. The Setup folder was visible and I right-clicked on the Setup folder and exported the Setup branch.
I went back to my Exchange 2007 Management installed server and imported the reg file.
After importing the reg file my problem was solved and I had another challenge with Export-Mailbox cmdlet.