Removing preinstalled apps in Windows 10

In Windows 10 releases, lots of apps are pre-installed. Different than in Windows 8/8.1, most of these apps cannot be uninstalled by GUI.
If you want to remove them, you still can do that by using powershell.

Steps:
1 Start powershell with administrator privilege.

2 Enter these 2 commands to prepare the workspace.

Import-Module Appx
Import-Module Dism

3 Enter this command to show all installed package.

Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation

You will see some apps listed. The packages with status Installed are ready for your further removal.

4 Use this command to remove one app.

Remove-AppxPackage -Package packagefullname

The packagefullname is the text listed by step 3. Usually, it starts with Microsoft and end with 8wekyb3d8bbwe.
You need to repeat the step 4 for each app you want to remove.

Not all apps, Microsoft Edge for example, can be removed but most can.

Build a USB Stick for Windows Installation

After the ISO file of Windows installation disc downloaded, it’s possible to build a USB stick instead of burning a DVD disc.

To do that, you need a USB stick not less than 8GB as well as a working Windows. During the process, all data on this USB stick will be removed.

 

Phase 1: Preparing the USB stick

  1. From Windows client, run DiskPart as administrator. A console will be shown with the prompt “DISKPART> ” (without quotes, the same below).
  2. Enter “list disk” and press Enter. All disks will be shown with a number.
  3. Enter “select disk x” and press Enter. Replacing x with the number of disk shown in the step 2. If you run the step 2 again, you can see a star before the disk you selected.
  4. Enter “clean” and press Enter to clean the drive.
  5. Enter “create partition primary” and press Enter to create a partition filled this drive.
  6. Enter “format fs=fat32 quick” and press Enter to format this partition quickly with FAT32.
  7. Enter “active” and press Enter to mark this partition as active.
  8. Enter “assign” and press Enter to assign a letter to this drive.
  9. Enter “exit” and press Enter to quit DiskPart.

 

Phase 2: Copy files into this drive.

You just need to copy all files within the ISO file into this drive, making the root of this drive the same as the ISO file system. Do not put these files into any sub folder.

 

Phase 3: Optional, only if the Install.wim larger than 4GB.

If Install.wim is larger than 4GB, you cannot put it into this drive because no file larger than 4GB can be put into a FAT32 based partition beyond the limitation. You have to split it into smaller files. All other files should be copied as described in Phase 2.

To do that, you need to run this command:

DISM /Split-Image /ImageFile:d:\sources\install.wim /SWMFile:e:\sources\install.swm /FileSize:4096

It will split the install.wim from drive D into the USB stick drive E. Change these paths in your case.

 

Now you can use this USB stick to boot your computer and start the installation process like from the disc.

The sad thing is if you had to prepared this stick through Phase 3, the installation will be slower due to merging process, but nothing will be different in your installed system.

Increase WSUS downloading speed

The downloading of updates in Windows Server Update Services (WSUS) is based on Background Intelligent Transfer Service (BITS). BITS is designed to download big files using idle bandwidth only. If you need to speed up the downloading process, you may change it to use a foreground mode.

 

To do that, you need a SQL Management Studio to connect the database used by WSUS. The database name is SUSDB. You can run this command in that database specified:

update susdb.dbo.tbConfigurationC set BitsDownloadPriorityForeground=1

For reversion, run it again with replacing the 1 to 0.

 

Mixed Windows Authentication in IIS 8.5 (ASP.Net)

Update:

Actually, this not works. It looks OK because of the cache of client. There is no way to do this as I know.


Original:

 

I got a case recently to build a site in IIS 8.5:

  • When the visitor is logged on to the desktop with domain account, use this account for this website.
  • When the visitor is not using domain account, do not pop up a login window asking for domain account, redirecting to a version for anonymous instead.

I thought it’s simple in IIS setting but I was wrong. The anonymous cannot work parallelly with Windows authentication.

After some digging in Google, I started my test:

  1. Deploy the site by using anonymous authentication.
  2. Select the login page for detecting domain user and change that page to Windows authentication instead of anonymous model.
  3. Add a custom page for this page on error 401. Model is set to “Execute a URL on this site”.

It works good but…

When the login page opened, it should contain a Url as parameter for returning back to the original page. So I have to deal it in the customized 401 page. I turned that page to an ashx with the command context.Response.Redirect. The URL for returning can be cut from context.Request.RawUrl.

After that, it went wrong. Form the same server which has the IIS installed, it still works well. But when I try this page on another computer, it will always redirect to the anonymous version page no matter it’s from the desktop logged with domain account or not. I’m sure that the site is added as Intranet zone and automatically logon is set in this zone.

Checked by network monitor, the browser will not get the 401 response in this scenario. As the ashx file request, only the 302 code is returned. That’s the reason why the browser won’t be notified to logon with the current user.

The solution is: if you want to use ashx with redirect function as a customized 401 page still, do not use context.Response.Redirect. Instead, try to do that with an HTML function with the 401 code in HTTP response.

context.Response.Status = "401 Unauthorized";
context.Response.StatusCode = 401;
context.Response.ContentType = "text/html";
context.Response.Write(@"<html>
<head>
<title>Redirecting</title>
<meta http-equiv=""refresh"" content=""0; url=" + redirectUrl + @""" />
");

It works like a charm.

I guess (yes, guess) when the browser get a 401 response first time, it will retry to the previous submitting/navigation with the domain account for login. If it’s failed again, it will pop up a login window after the html page is displayed. So as I required in HTML code, after it navigate to another page, the browser has no chance to display the login window. That’s the deal.

All I’m sure is it really works well. Hope it useful to you.

Set SQL Alias

When you need to move the SQL Server instance to another server, you can use SQL Alias to get avoid of changing connection string for softwares which use this database.

All you need is setting up SQL Alias on the computers running your softwares. Nothing need to be done with the SQL Server if it’s installed other than the computers running applications.

The tool for setting up SQL Alias is included with Windows. You just need to run cliconfg.exe to set. Be careful the typing — it’s not config.

If your Windows is x64 based, you may need to choose the right version of that tool. The x64 version is C:\Windows\system32\cliconfg.exe and the x86 version can be located as C:\Windows\syswow64\cliconfg.exe. If you don’t know which is the right one, set up both of them.

WDS of Windows Server 2012 R2 with Update

No matter the way you get the Windows Server 2012 R2 with Update, by fresh installing from the CD supplied by MSDN Subscription or simply upgrading by Windows Update, the WDS of this system sucks.

 

If you planned to upgrade, please remember to backup the Boot folder of WDS while using Windows Server 2012 R2 without that update. After upgrading process, you need to stop WDS service, replace the Boot folder with your backup and restart WDS.

 

The Boot folder provided with Windows Server 2012 R2 with Update or Windows 8.1 with Update, is not compatible with capture image creation. If you use the original Boot folder from Windows Server 2012 R2 with Update, or get the Boot folder upgraded by adding a boot.wim from Windows Server 2012 R2 with Update or Windows 81. with Update, it can boot but cannot support capture image any more. No matter which boot file your capture image is created based on, even you get your capture image from another server, it just cannot boot your PC for capturing. After loading finished, you will get an error in winload.exe with the status code 0xc000000f.

 

To avoid this, do NOT use the boot.wim from Windows Server 2012 R2 with Update or Windows 8.1 with Update ISO files which are provided by MSDN Subscription. And do NOT use the Boot folder provided with the WDS of Windows Server 2012 R2.

To fix this, you just need to restore the WDS Boot folder from your backup before upgrading this update. If you don’t have a backup, copy this folder from another server which is hosted by Windows Server 2012 R2 (without that Update).

 

Still don’t know the reason but it’s not suprised me that WDS is not tested well. In many versions of Windows Server, WDS cannot work well.

 

Related:

Do NOT add a boot file for WDS from Windows 6.3 with Update

Caution: Upgrading Windows to 2012 R2 may change the interface number of network interface card

Some server has specified settings wrote by command “route -p” to deal with multiple internet or intranet connections. To make it work with RRAS, the option “if <number>” must be provided with each route command.

If you’re planning to upgrade such a server to Windows Server 2012 R2, be careful, you may have to get a console connection. Through upgrading process will not failed or at least give you any warning about route settings, after it done, the interface number of NIC (network interface card) will be changed. It means you have to remove and add the related persistent routes to resume the remote connection before you can use this server again.

If you cannot get a console, you may want to disable RRAS, remove the “if <number>” parameter from the route command before upgrading.