PowerShell : Windows 10 Modern Application Removal Script

If you have Windows 10 you’ve not doubt seen the new modern apps and either love them, hate them or just don’t want to deal with them. Windows 10 does not provide an easy way to remove any of these applications or to keep them from running which can be a major issue for low RAM systems. The good news is they can quickly be removed via a few PowerShell commands or a script. The script below is one I’ve been using to manage them on my systems. You can also find a link to GitHub where I maintain this and several other PowerShell scripts I routinely use.

GitHub PowerShell Scripts | GitHub W10RemoveCoreApps Script
Read more of this post

Windows/Office Digital River Links Updates [11/23/14]

I’ve  made some updates to the Windows/Office Digital River Links page to correct some broken links. Microsoft is currently in the process of migrating from their old Digital River servers to Azure. Due to that change many of the links are being changed in addition to some products being phased out. I’ll try to keep up with the changes but if I miss something just let me know. I will also be looking into a cleaner download interface so you’re not assaulted with a page full of links. The goal is a dropdown interface where you can just select your product and language and get your links. Going forward, this post will serve as the page for updates and contact for the Microsoft links.

Now as for the links themselves, I’ve made a few changes to how they are presented. For the most part they will remain the same but with the addition of alternative version and download links. For most people you can just download the latest version link but I’ll keep old versions linked for those who need them. Since this page is the second most popular page on the site I’m going to give it a little more attention and spruce it up.

Finally, a thanks to heidoc.net who figured out the change to the link structure and serve as the base source for links.

Windows/Office Digital River Links

Todo [11/23/14]:

  • Fix Broken links – Ongoing
  • Add additional alternative links
  • Clean up link presentation

Weekend Project: Process Explorer Auto Install

I was bored this weekend and decided to try my hand at making a PowerShell script to automate the install of Sysinternals Process Explorer. It’s pretty rough product of about 3 hours of work. I’ll make improvements in the future as I get time. In any case, it’s available below.

#### Downloads Process explorer from download.sysinternals.com,
#### unzips it into Program Files and then cleans up.
####
#### Sources:
####	s1: http://nyquist212.wordpress.com/2013/09/23/powershell-webclient-example/
####	s2: http://sharepoint.smayes.com/2012/07/extracting-zip-files-using-powershell/

#Checks for Administrator privileges and opens an elevated prompt is user has Administrator rights
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{   
    $arguments = "& '" + $myinvocation.mycommand.definition + "'"
    Start-Process powershell -Verb runAs -ArgumentList $arguments
    Break
}

# s1 
Function Get-Webclient ($urla, $out) {
    $proxy = [System.Net.WebRequest]::GetSystemWebProxy()
    $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
    $request = New-Object System.Net.WebClient
    $request.UseDefaultCredentials = $true ## Proxy credentials only
    $request.Proxy.Credentials = $request.Credentials
    $request.DownloadFile($urla, $out)
}

# s2 

# Expands the entire contents of a zip file to a folder
# MSDN References
# - Shell Object:   http://msdn.microsoft.com/en-us/library/windows/desktop/bb774094(v=vs.85).aspx
# - SHFILEOPSTRUCT: http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795(v=vs.85).aspx
function Expand-Zip (
    [ValidateNotNullOrEmpty()][string]$ZipFilePath,
    [ValidateNotNullOrEmpty()][string]$DestinationFolderPath,
    [switch]$HideProgressDialog,
    [switch]$OverwriteExistingFiles
    ) {
    # Ensure that the zip file exists, the destination path is a folder, and the destination folder
    # exists. The code to expand the zip file will *only* execute if the three conditions above are
    # true.
    if ((Test-Path $ZipFilePath) -and (Test-Path $DestinationFolderPath) -and ((Get-Item $DestinationFolderPath).PSIsContainer)) {
        try {
            # Configure the flags for the copy operation based on the switches passed to this
            # function. The flags for the CopyHere method are based on the SHFILEOPSTRUCT
            # structure's fFlags field. Two of the flags are leveraged by this function.
            # 0x04 --- Do not display a progress dialog box.
            # 0x10 --- Click "Yes to All" in any dialog box displayed. Functionally overwrites any
            #          existing files.
            $copyFlags = 0x00
            if ($HideProgressDialog) {
                $copyFlags += 0x04
            }
            if ($OverwriteExistingFiles) {
                $copyFlags += 0x10
            }
            
            # Create the Shell COM object
            $shell = New-Object -ComObject Shell.Application
            
            # Get references to the zip file and the destination folder as Shell Folder COM objects
            $zipFile = $shell.NameSpace($ZipFilePath)
            $destinationFolder = $shell.NameSpace($DestinationFolderPath)
            
            # Execute a file copy from the zip file to the destination folder; which effectively
            # extracts the zip file's contents to the destination folder
            $destinationFolder.CopyHere($zipFile.Items(), $copyFlags)
        } finally {
            # Release the COM objects
            if ($zipFile -ne $null) {
                [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($zipFile)
            }
            if ($destinationFolder -ne $null) {
                [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($destinationFolder)
            }
            if ($shell -ne $null) {                
                [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($shell)
            }
        }
    }
}

function mkdirs {
    mkdir $sDir\temp\ -force > $null
    mkdir $sDir\ProcessExplorer\ -force > $null
    mkdir "$start\Process Explorer" -force > $null
}

function shortcuts ($target, $link) {
    # Create a Shortcut with Windows PowerShell
    $TargetFile = $target
    $ShortcutFile = $link
    $WScriptShell = New-Object -ComObject WScript.Shell
    $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
    $Shortcut.TargetPath = $TargetFile
    $Shortcut.Save()
    }

# Variables
$sDir = $env:programfiles
#$uDir = $env:allusersprofile
$start = [Environment]::GetFolderPath('CommonStartMenu') + "\Programs"
$url = "http://download.sysinternals.com/files/ProcessExplorer.zip"
$file = $sDir + "\temp\ProcessExplorer.zip"

# Makes directories:
# ProcessExplorer directory in Program Files according to Environment variable\
# temp directory in Program Files for download
mkdirs
Get-Webclient $url $file
Start-Sleep -s 2
# Closes Process Explorer if running
Get-Process procexp* | stop-process –force
Expand-Zip $file "$sDir\ProcessExplorer\" -HideProgressDialog -OverwriteExistingFiles
Remove-Item "$sDir\temp\" -recurse
# Creates Start Menu shorcuts
shortcuts "$sDir\ProcessExplorer\Eula.txt" "$start\Process Explorer\EULA.lnk"
shortcuts "$sDir\ProcessExplorer\procexp.chm" "$start\Process Explorer\Process Explorer Help.lnk"
shortcuts "$sDir\ProcessExplorer\procexp.exe" "$start\Process Explorer\Process Explorer.lnk"
# Accepts EULA and starts minimized
start-process $sDir\ProcessExplorer\procexp.exe -ArgumentList "/AcceptEula /t"

 

Download ProcessExplorerInstaller.ps1 from Github
GitHub | PowerShell-Scripts / ProcessExplorerInstaller.ps1

Changing Services with the Command Line

Changing services, whether changing the startup type or stopping/starting them, is something every user will have to do. While it’s easy to simply go through the Services MMC that can be time consuming, especially when a PC is being slow. The prefered method would be through the Command Line, either manually or through a pre-written batch file. So how do you do this? Check below for details.
Read more of this post

Fixing corrupted Tasks in Windows

Ever had a corrupted task in Windows scheduler? It can happen after a restore, removable of software or accounts, a fail install or any number of other reasons. It can be infuriating to try to fix it, particularly if it’s corrupted enough to Task Scheduler can’t even show the task. It can also cause a variety of issue on your system and prevent you from adding new tasks, especially if they call the same program/script. How do you fix this? Looking in the Task Scheduler interface doesn’t provide much help due to it’s very minimal and simple management options. Even on Windows Server there aren’t very many options to work with. Turns out the solution is easy and requires nothing more than than deleting a file. Granted, you do need to know what file you’re looking for (which should be easy if you named the task logically).

The files can be found in your Windows folder under

C:\Windows\System 32\Tasks

This should be the same under all versions of Windows. Just find the problem task and delete or rename it. That’s all you need to do! A quick refresh of Task Scheduler should load the remaining tasks, sans those you removed. If any programs were affected by the corrupted task you should be able to restart them and continue any necessary troubleshooting.

How to get official ISO and Images from Microsoft for Free

For most of us if we need a Office or Windows ISO or image we either A) have to have the disc or B) hit up a torrent/download site for one. What if I told you that Microsoft offered official downloads of Windows, Office and other Microsoft products for free. They are offered through Microsoft’s Digital River Content service. It’s a great alternative to pirate sites or having to order a disc (which required a existing key and costs money) which can be a lot of trouble. I first discovered this source as I was building a library of ISO’s for my on-site technician job. I had some of the CD’s from past purchases but not all I would need.

So without further ado hit the links after the break for all the downloads. All the downloads are resumable and are quite fast. I will be updating this as I get time going forward.
Read more of this post

Using Google Chrome to make administration a breeze

Many people use Google Chrome on their personal computers to browse. It’s likely you use it on your work PC as well if your organization allows. Google Chrome loads most sites with ease, is frequently updated and has many customization options. It’s an all around good choice. It can also make your life as an admin much easier. A browser making administration easier? What magic is this? Well, lets look at some of the options.
Read more of this post

Verified by MonsterInsights