• Tip 49: How Do You Set Default User Profile Registry Settings

    This tip is for Windows 2000 and up. Instructions for Windows NT 4.0 can be found at; http://support.microsoft.com/kb/146050. The following instructions are based on Windows 7. The steps may be different in other versions of Windows.

    Since the instructions in this post will show how to edit the Windows registry I will post the standard Microsoft Support disclaimer.

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows. * For Windows 7, follow the following instructions; http://windows.microsoft.com/en-US/windows7/Back-up-the-registry.

    Okay, now with that out of the way we can get to editing the registry to make Windows do what we want. To make sure every new profile created on a machine gets specific user settings we will need to change the registry settings that are used to build all new profiles. The trick is first to understand where these default settings come from. Then when we know where they come from we need to be able to edit them and save them. Once that is done all new profiles will be created with whatever settings we want.

    The location of where new profiles copy their user registry settings is located on the file system at %SystemDrive%\Users\Default\NTUSER.DAT in Windows 7 and Windows Vista, in Windows XP it is located at %SystemDrive%\Documents and Settings\Default User\NTUSER.DAT. Now that we know what file is copied to create all new profile user registry settings we just need a way to edit the settings. Well there’s a tool for that, it’s called Regedit.exe.

    The trick with editing the default user profile registry settings is to first know that it is not available in Regedit.exe by default. We will need to load the NTUSER.DAT file into Regedit.exe to be able to edit the settings. Open Regedit.exe by going to Start and typing Regedit, then right-click the search result and select Run as administrator. If you are currently logged on with a non-administrator the User Account Control box will allow you to provide administrative credentials, otherwise click Yes in the UAC box.

    When Regedit starts, navigate to HKEY_USERS and left click it.

    Go to the menu and select File->Load Hive.
    For more information on loading Windows Registry hives; http://technet.microsoft.com/en-us/library/cc732157.aspx.

    Browse to the NTUSER.DAT file based on which Windows version you are using and Open it. You will have to have, ‘show hidden and system files’ enabled in the folder options control panel. For more information; http://windows.microsoft.com/en-US/windows7/Show-hidden-files.

    Give the hive a name, it does not matter what name you give it. Here I used Default Profile, but it could have been anything.

    In Regedit, browse to HKEY_USERS->whatever hive name you gave. You now be able to edit the default user profile registry
    settings. Remember to back them up first before editing!

    When finished, go to the menu File->Unload Hive.

    That’s it! Any settings you change in the loaded hive will be copied to ever new user profile that is created on that machine.

  • Tip 51: Cleanup on Isle 3! Get Back Disk Cleanup Wizard on Windows Server 2008 & 2012

    This tip is for the server administrators out there with messy disks on Windows Server 2008 and 2012.

    I just finished upgrading all of my lab infrastructure to the newest coolest and cloudiest server OS, Windows Server 2012. I did an actual upgrade also, not a custom installation. The difference being that an upgrade will keep your files and folders in place so you do not lose any data; while a custom install will format your system disk.

    The upgrade finished without a hitch on all on my machines; 2 domain controllers, 2 Hyper-V servers and a storage server. The only issue was that on all of my system drives I was running out of room, on account the system drives are SSD or virtual hard drives.

    When you do an upgrade instead of a custom installation the machine will end up with a folder on the root of the system drive, normally C: called Windows.old. This is the old version of Windows and unless you have some files saved in the Windows or Program Files folders you can safely delete this after the upgrade is complete. Note that any files saved in the user profiles location will be copied to the new installation.

    Only problem with deleting the Windows.old folder is that if you try to just delete the folder you will receive nasty errors and warnings like these.

    Now you could go into the permissions and take ownership of all of the files and get through the system file warnings, but it would be much easier if you could just use Disk Cleanup Wizard to delete the old folder. Plus you get the option of deleting other non essential and temporary files with Disk Cleanup. Now to run the cleanup right-click the disk and select properties and there should be a button next to the pie chart of the disk, oops, it's not there!

    If you search for missing disk cleanup on Windows Server, you may end up at this Technet page; http://technet.microsoft.com/en-us/library/ff630161(v=ws.10).aspx. Which directs you to copy files from crazy Windows\WinSxS locations and run the Cleanmgr.exe program. I will have to track down how this got published, but just know that it is not a good practice to just go copying files from the Windows Component Store (WinSxS) willy nilly. Plus if you do this the button will still not be shown on the disk properties. So how do you get the disk cleanup back the right way?

    The Desktop Experience feature is the feature that enables disk cleanup on Windows Server 2008 and 2012, so just install this feature and you can cleanup you disk as much as you want.

    In Windows 2008 use Server Manager to add the feature.

    In Windows Server 2012 it's even easier, use PowerShell to enable the feature.

    Add-WindowsFeature Desktop-Experience

    Now the button is back and you can delete the folder.

    Now go clean you disks before the next tip!

  • Tip 34: Adding a SharePoint 2010 Search Suggestion

    This tip is for SharePoint Server 2010, Search Server 2010 and Search Server 2010 Express.

    SharePoint Server 2010 and Search Server 2010 Express include a new feature for search called Search Suggestions. Search suggestions are listing below the search box that suggests search terms while you are typing your search query. They have been around for a few years in sites like www.bing.com and are now integrated into SharePoint 2010. Below is a screenshot of a SharePoint Enterprise Search Center site with a suggestion.

    SearchSuggestion

    Suggestions are automatically built based on what search results are actually clicked on. It takes 6 clicks within a year for SharePoint to add a suggestion; if an administrator needs to add a suggestion manually this can be done using the SharePoint 2010 Management Shell (PowerShell). The commands below will add the suggestion, "Suggestion" to the first Search Service Application and run the Prepare Query Suggestions timer job now. The Prepare Query Suggestions timer job is set to run daily between 1AM and 11PM local server time so this will speed up the time before the suggestion will appear in the search query suggestions list.

    $ssa=Get-SPEnterpriseSearchServiceApplication

    New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language en-US -Type QuerySuggestionAlwaysSuggest -Name "Suggestion"

    $timer=Get-SPTimerJob|? {$_.Name -eq "Prepare Query Suggestions"}

    $timer.RunNow()

    After the above commands have been run and the timer job has been run, the suggestion and other suggestions in a Search Service Application can be listed by running the following command from the SharePoint 2010 Management Console.

    Get-SPEnterpriseSearchQuerySuggestionCandidates -SearchApp $ssa

    To remove the suggestion, run the following command.

    Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $ssa -Language En-Us -Type QuerySuggestionAlwaysSuggest -Identity "Suggestion"

  • Installing SharePoint 2010 RTM Over Previous Versions

    Before even writing on how this can be done I have to state that I would not recommend this be done on a production system. Previous versions of any software is going to leave traces of itself even after an uninstall so, while everything may seem to be working fine at the time, issues may occur down the line from this type of workaround.

    While trying to install SharePoint RTM version, the setup program may produce the following error if a previous version was installed; "The install in progress conflicts with a previously installed Microsoft Office 2010 Server product" Fig. 1. To find out how this error can be fixed, first let’s look at how a Microsoft Installer setup checks for previous versions of a program.

    Fig. 1

    2010Insterr

    When the setup for SharePoint 2010 runs the Windows Installer components it checks for previous versions. These previous versions will usually be listed in the Control Panel->Programs and Features in Windows 2008. If an update has been installed for a product though, it may be listed in the “View installed updates” link in Programs and Features. Fig. 2.

    Fig. 2

    SPRTMinst4

    When the View installed updates is clicked the Programs and Features will change to list only updates to the Programs installed. Updates listed here can be uninstalled. If any SharePoint updates are listed click them and uninstall. Fig. 3.

    Fig. 3

    SPRTMinst5

    After uninstalling all of the SharePoint related programs from both “Programs and Features” and “View installed updates” reboot the computer and try the install again. If the setup is still finding the previous versions check that there are no programs listed in the registry under the following key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Look first for any key with names similar to the ones in Fig. 4. See the following KB article on using the Windows Registry Editor for the warnings on usage; http://support.microsoft.com/kb/256986.

    Fig. 4

    Fig. 1

    For each GUID found ending in 0000000FF1CE in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, find the UninstallString value and copy out the data by double-clicking or right-clicking and selecting Modify. In the “Edit String” window copy the “Value data”. Fig. 5. This is the command that will uninstall the package. Next, open a command prompt as Administrator by going to Start->All Programs->Accessories->Command Prompt; Right-Click Command Prompt and select “Run as administrator”. You may have to do this multiple times to remove all of the Office related registry entries in the uninstall key.

    Fig. 5

    Fig. 2

    After all of the entries are removed remember to reboot the computer, as the MSI will more than likely need the reboot to clean up all of the in use resources and may not let you spin up another install until a reboot is completed.

  • Tip 33: Branch Cache and SharePoint 2010, or How to Make SharePoint Fast over Slow Networks

    This tip is for SharePoint Foundation 2010 and SharePoint Server 2010 when running on Windows 2008 R2 and browsing SharePoint on Windows 7 and Windows 2008 R2 and up.

    My internal training in the next version of SharePoint has sparked some intriguing thoughts around what will be possible in the near future to help our customers in situations where bandwidth constraints are making SharePoint performance less than optimal.

    I have searched high and low, internally and our external sources (TechNet, MSDN), for any SharePoint specific information in regards to Branch Cache. There is a good white paper here; http://technet.microsoft.com/en-us/library/ff468721(WS.10).aspx on setting up a lab to test Branch Cache. The lab in this white paper is a good start on how to setup a lab where you can test the functionality of Branch Cache for SharePoint as it has steps on configuring IIS 7.5 for Branch Cache, which would be the same as setting up SharePoint for Branch Cache.

    There are a few things I would like to add to the information given in the white paper though.

    When testing the speed of downloading documents from the SharePoint server on client machines there is a very easy way to visualize the difference between a slower WAN type connection and the cached document download. Turn on bandwidth connection limits in IIS for the web application you are testing caching on (Figure 1). While testing, I set the Maximum Bandwidth (Bytes/second) to 57344; which is 50KB a second, or about the same as the old 56K MODEM days (Figure 2). For a multi megabyte file, you can see in the IE download window that without caching the file transfers at about 50KB (Figure 3).

    Figure 1:

    IIS Advanced Settings

    Figure 2:

    IISAdv2

    Figure 3:

    DL56K

    The first time the document is downloaded from the SharePoint server, you will see the speed is about the same as the IIS web application bandwidth setting. Downloading the same file again, you should see that the file is downloaded much faster than the first time. This is the Branch Cache version of the file being downloaded. I could not snap a screenshot of the second download as the 3.5MB file completed too fast (under a second!).

    To rerun the test on the same client run the following command to clear out the Branch Cache files on all of client computers.

    NETSH branchcache flush

    That’s it for now, the white paper above has some more information on how to use Performance Monitor to monitor Branch Cache usage and find out exactly how many bytes you are saving. So now when SharePoint 2010 is released you can rejoice in your new found SharePoint speed!