Use PowerShell to change user roaming profile locations

Here’s a script I used recently to change users’ roaming profile paths from one server (\\OLDSERVER) to another (\\NEWSERVER). It identifies the old server by comparing strings with a search term and only changes those. It also doesn’t just fire and forget – it stops every 5 records to confirm you wish to continue.
Continue reading

Posted in General | Leave a comment

WDS: Add Driver Packages to Image wizard fails

When you attempt to add driver packages to a boot image using the Windows Deployment Service MMC which fails to complete or the process hangs, you’re left with a mounted version of your WIM image buried deep somewhere in your WDS server.

The default mount location of the offending images is %TEMP%, or usually:
C:\Users\[username]\AppData\Local\Temp\1

Inside this folder will be the mount location folder, often ~$WDSMGMT.00[n] where [n] is a number.

In order to discard the mounted WIM, use the following command:
dism /unmount-wim /mountdir:C:\Users\[username]\AppData\Local\Temp\1\~$WDSMGMT.000 /discard

Upon doing so, ensure you have closed all Explorer windows or you may receive the following error.

Error: 0xc1420117

The directory could not be completely unmounted. This is usually due
to applications that still have files opened within the mount directory.
Close these files and unmount again to complete the unmount process.

If you have closed all open Explorer windows and you are still receiving the error, open Regedit and navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\WIMMount\Mounted Images and delete any subkeys there.

If all else fails, a reboot of your WDS box may be necessary to terminate any processes that might still be hanging on to the folder. Once you have rebooted, re-check and delete any sub-keys in the registry before again attempting to unmount and discard the image.

-Lewis

Posted in General | Leave a comment

Windows cannot connect to the printer 0x0000007e

When faced with the above error while installing an HP printer to a workstation recently, I tried absolutely everything to resolve it.

I removed drivers (in some cases I had to do this manually with Explorer and regedit!), stopped and restarted print spoolers, manually removed settings and still it wouldn’t install, always giving “Windows cannot connect to the printer. 0x0000007e”. I simply couldn’t connect to a shared printer from a Windows 7 workstation.

After searching the Internet at length and trying a great many number of other options, I Continue reading

Posted in General | 3 Comments

Tab completion or auto completion in Command Prompt

Should you find that Tab or auto completion isn’t working when you fire up a command prompt window. Check this KB article for information on how to re-enable it.

http://support.microsoft.com/kb/244407/en-gb

- Lewis

Posted in General | Leave a comment

Quickly back up your Windows Server DHCP configuration

Something I used in a project recently (but I must tip my hat to a colleague who introduced me to it) is using net shell to back up your Windows Server DHCP configuration in to a readable format to allow you to selectively restore sections lost or even to assist in migrating settings between servers.

On your DHCP server, type the following at an Administrative command prompt:

netsh dhcp server dump > C:\dhcpconfig.txt

This command will output a net shell command file to allow you to restore your configuration at a later date. If you have many DHCP reservations that you must migrate to another server, this is an ideal way of dumping the configuration. You can then edit the file and execute the commands using net shell to re-create the DHCP reservations on the new server.

NB: The configuration file will have references to the original DHCP server’s IP address so take care to edit these references before executing the file.

Once you have your file, or you’re simply restoring or testing, execute the following command to re-create the DHCP configuration on the server.

netsh exec c:\dhcpconfig.txt

- Lewis

Posted in General | Leave a comment

Moving home

At the end of this week I’ll be moving home. I’m moving from West Yorkshire to Cheshire and will be starting a new job on 27th June. In August last year I decided to start looking for a new home in Cheshire to be nearer to my girlfriend and luckily I found one fairly quickly. I was dealing with the house purchase over Christmas and finally got the keys at the end of January – the following three months were spent getting settled in and doing a fair amount of decorating, which still isn’t finished. At the end of April I secured a new job close to my new house and resigned from my current position so there has been a lot of change for me recently.

Now you all know why there was such a large gap in my MCITP exam preparations from December to April!

Needless to say, when I move out this weekend, my websites will be offline. When they come back online, they will be being served from my new place – I don’t know how long that will take but…this is only a private blog. I’ll want to get my server back on to tinker with the labs for my next MCTS fairly quickly so I don’t envisage it being too long.

-Lewis

Posted in General | 1 Comment

MCITP: Enterprise Administrator on Windows 2008

Finally done it. Took me a little longer than expected but I decided to buy a house and I had to find another job nearer to my new home but I’ve done it. I passed all five exams first time but that’s not to say they were easy!

-Lewis

 

EDIT: Forgot the fact that I passed the 70-680 – Windows 7, Configuring exam to obtain my final TS certification and achieve the MCITP. I did server TSs first (70-640, 70-642 & 70-643), then the PRO (70-647) and finished with Windows 7 (70-680) to obtain my MCITP. Logo for the MCTSs below:

Posted in General | Leave a comment

Backup from a Volume Shadow Copy snapshot

Backing up a Volume Shadow Copy snapshot might not initially sound like something you’d need or even want to do but when all else has failed, what choice do you have? Let’s say you deleted a bunch of files from your file server and you discover that your offsite backup selection lists were incomplete or had been tampered with by an unruly System Administrator. Your file server doesn’t have the files and your backup tapes don’t have the files but your Volume Shadow Copies do. Great, I’ll just restore from them this once…

And there’s the problem, you need to know all of the files you need to restore before the oldest VSS copy expires or needs overwriting. Continue reading

Posted in General | 1 Comment