Remove preinstalled window 10 apps for all users using powershell

To remove the preinstalled windows 10 apps for all users using powershell, open powershell as Administrator, and paste the following.

#Be careful with the first line ... you may want to keep the windows store installed as alot of applications come through there now, rather than direct installs.
#Get-appxpackage -allusers windowsstore | install-appxpackage
Get-appxpackage -allusers xboxapp | remove-appxpackage
Get-appxpackage -allusers 3dbuilder | remove-appxpackage
Get-appxpackage -allusers zune | remove-appxpackage
Get-appxpackage -AllUsers camera | remove-appxpackage
Get-appxpackage -AllUsers solitaire | remove-appxpackage
Get-appxpackage -AllUsers bing | remove-appxpackage
Get-appxpackage -AllUsers getstarted | remove-appxpackage
Get-appxpackage -AllUsers photos | remove-appxpackage
Get-appxpackage -allusers alarms | remove-appxpackage
Get-appxpackage -allusers skype | remove-appxpackage
Get-appxpackage -allusers phone | remove-appxpackage
Get-appxpackage -allusers maps | remove-appxpackage
Get-appxpackage -allusers people | remove-appxpackage
Get-appxpackage -allusers messaging | remove-appxpackage
Get-appxpackage -allusers connectivity | remove-appxpackage
Get-appxpackage -allusers communication | remove-appxpackage
Get-appxpackage -allusers candy | remove-appxpackage
Get-appxpackage -AllUsers office | Remove-AppxPackage
Get-appxpackage -AllUsers twitter | Remove-AppxPackage

If you didn’t actually read the above before copying and pasting (as we may or may not have done), you will need to re-install the store if you want it (which is likely):

Get-AppXPackage WindowsStore -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Powershell is an amazing thing that allows the reasonably knowledgeable person to do many functions easily which would normally require alot more time and or effort.

Adding Remote Desktop (RDP) support to windows 10 home

Microsoft Windows 10 home is easily modified to add the Remote Desktop features. These feature are only normally available in the Professional version of win10 (pro).

You don’t need to pay for the professional version to have Remote Desktop services installed on your computer. Some smart people have worked out how install Remote Desktop Server on Win10 Home.

A good article explaining how to enable remote RDP access in Windows 10 Home edition, but sadly RDPWrap isn’t updated for the latest version of windows 10, So we decided to make it easier for people to find a working RDPWrap solution:

  1. Copy the files from the archive “RDPWrap-v1.6.2.zip” (or newer) to the “%ProgramFiles%\RDP Wrapper” directory.
  2. DO NOT use other location to install/extract the RDP Wrapper files, as it will not work,
    USE ONLY the “%ProgramFiles%\RDP Wrapper” directory (normally C:\Program Files (x86)\RDP Wrapper)
  3. Extract/Copy the files/folders from the archive “autoupdate.zip” to the “%ProgramFiles%\RDP Wrapper” directory
  4. To enable autorun of autoupdate.bat on system startup, run the following helper batch file as administrator: “%ProgramFiles%\RDP Wrapper\helper\autoupdate__enable_autorun_on_startup.bat”
  5. Set in your Antivirus/WindowsDefender an exclusion on the folder “%ProgramFiles%\RDP Wrapper” to prevent the deletion of RDP Wrapper files
  6. Now you can use the autoupdate batch file to install and update the RDP Wrapper. Please run the following autoupdate batch file as administrator: “%ProgramFiles%\RDP Wrapper\autoupdate.bat”

Remotely Lock & Shutdown computers using PowerShell

PowerShell takes the functionality of batch scripts to the next level and allows you to Remotely Lock & Shutdown computers using PowerShell.

The following needs to be run on each computer if using a workgroup setup. or changed in your AD security policy (to make it permanent – which isn’t advisable without signing the script)

https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

Enable-PSRemoting
Set-executionpolicy unrestricted
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.250" -Force 
Get-Item WSMan:\localhost\Client\TrustedHosts
Restart-Service WinRM

The above does the following:
Enable-PSRemoting sets up the policies and firewalls to allow remote connections using powershell
Set-executionpolicy unrestricted changes the local execution policy to allow execution of all scripts (not just signed)
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.250" -Force Adds server IP into the trustedhosts to allow execution
Restart-Service WinRM restarts windows remote management service

We are assuming that your server IP is 192.168.1.250, change as appropriate

Now to the actual shutdown code that will be run from our “Server”:

Function Get-MyCredential{
 param(
 [string]$username,
 [string]$password
 )

 $secStr = new-object -typename System.Security.SecureString
 $password.ToCharArray() | ForEach-Object {$secStr.AppendChar($_)}
 return new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$secStr
}
Function Lock-Machine{
 param(
 $machineName
 )

 & winrm set winrm/config/client `@`{TrustedHosts = `"$machineName`"`}
 Invoke-Command -ComputerName $machineName -ScriptBlock { tsdiscon.exe console } -Credential (Get-MyCredential User Pa$W0rd)
 }
Function Hibernate-Machine{
 param(
 $machineName
 )

 & winrm set winrm/config/client `@`{TrustedHosts = `"$machineName`"`}
 Invoke-Command -ComputerName $machineName -ScriptBlock { &"$env:SystemRoot\System32\rundll32.exe" powrprof.dll,SetSuspendState Hibernate } -Credential (Get-MyCredential Administrator password)
}
Lock-Machine "192.168.1.84"
#Lock-Workstation "NameOfTheComputer" (Get-Credential)
Stop-Computer -ComputerName 192.168.1.85 -Force -Credential (Get-MyCredential User Pa$W0rd)

Relaunching a windows app using a batch script

We recently had need to restart an app server exe automatically when the demonstration license it was running on caused the server to close regularly, annoying everyone trying to learn the system. We had need of a script (YAY) to check if it was running and restart it when required.

Requirements:

  1. Check to see if the app is running on start if not running, start it.
  2. wait for some period of time (60 seconds)
  3. Check to see if the app is running, if not running, start it

Flourishes:

  1. Date app last restarted is displayed in title
  2. ability to close script with a button press
  3. ability to cancel wait time and relaunch app now
  4. ability to log when app was restarted

Working on it:

checking if a process is running:

It turns out that checking if a process is running is relatively easy:

tasklist /FI "IMAGENAME eq appServer.exe" | findstr "appServer.exe"
if %ERRORLEVEL% == 1 Echo No server Process found
if %ERRORLEVEL% == 1 goto start

and of course, now you have to choose:

choice /T 60 /D y /C YABCDEFGHIJKLMNOPQRSTUVWXZ /N >NUL
if %ERRORLEVEL% == 1 goto loop

now we start the exe

start "" "C:\Program Files (x86)\AppVision 4.0\Bin\appServer.exe"

Set the title

title appServer (re)Started at %NowDate% %NowTime% (Press X to exit script before closing appServer.exe)

Pulling it all together:

@echo off
title appServer (re)Launching script started at %time:~0,2%_%time:~3,2%_%time:~6,2% (Press X to exit script before closing appServer.exe)
pushd "C:\Program Files (x86)\AppVision 4.0\Bin"

:loop
timeout 2 >NUL
rem ping 127.0.0.1 -n 2 >NUL
echo.
tasklist /FI "IMAGENAME eq appServer.exe" | findstr "appServer.exe"
if %ERRORLEVEL% == 1 Echo No server Process found
if %ERRORLEVEL% == 1 goto start
echo Server process found at %time%, waiting 60 seconds
echo.
rem timeout 60
rem ping 127.0.0.1 -n 30 >NUL
choice /T 60 /D y /C YABCDEFGHIJKLMNOPQRSTUVWXZ /N >NUL
rem echo %ERRORLEVEL%
if %ERRORLEVEL% == 1 goto loop
goto eof

:start
set NowTime=%time:~0,2%_%time:~3,2%_%time:~6,2%
set NowDate=%date:~10,4%_%date:~4,2%_%date:~7,2%

cls
echo starting
start "" "C:\Program Files (x86)\AppVision 4.0\Bin\appServer.exe"
title appServer (re)Started at %NowDate% %NowTime% (Press X to exit script before closing appServer.exe)
choice /T 10 /D y /C YABCDEFGHIJKLMNOPQRSTUVWXZ /N >NUL
rem ping 127.0.0.1 -n 11 >NUL
goto loop

:eof
popd
echo script finished due to keypress
rem pause

Opening ISO CD/DVD image files

We often get asked how to get information from an .ISO .bin or other type of CD / DVD image file, so here are the easiest ways we know of.

  1. Mount the ISO as though it was burnt to a CD/DVD and inserted into a drive on your PC
  2. Extract all files from the image to a directory on your PC

Mount the CD/DVD Image

Download and install Virtual CloneDrive from slysoft, double click on your file and start browsing.

Extract the files

Download and install Universal extractor, then right mouse click on the file and choose extract, select a location, and kick back and relax for a minute or two while the magic happens.