Set PowerShell icon launch to default to run as Administrator

Many commands in PowerShell will not run unless they are run as an administrator.  You can of coarse right click on the taskbar icon and choose the ‘Run as Administrator’ option. But if you prefer to have the icon or shortcut default to run PowerShell as Administrator then you can right click on it once, and choose the ‘Properties’ item.

image

In the window that pops up, near the bottom right of the window click  the ‘Advanced’ button.

image

On the next (and last) screen, you will see a checkbox with ‘Run as administrator’. make sure that checkbox is selected, click ‘OK’, then ‘OK’ on the main Properties window to exit .

image

From now on out, when you click the PowerShell icon, it will run as administrator and you should see the Administrator prefix displayed in the PowerShell title bar.

image

Get memory configuration of all vm’s on hyper-v server and output to text file

Two line powershell script that gets memory configuration of all vm’s and outputs to text file.  Change path and name of vmmemory.txt to suit your needs.

Works on Server 2012 with powershell 3

Get-VM | Get-VMMemory | out-file -filepath C:\VMMemory.txt
C:\VMMemory.txt 

Get all vm’s on a hyper-v server and output to text file

This two line PowerShell script will get all vm’s on a hyper-v server and output to text file. Change path and name of vmrunning.txt to suit your needs.

Works on Server 2012 with powershell 3

Get-VM | Where-Object {$_.State -eq ‘Running’} | out-file -filepath C:\VMrunning.txt
C:\VMrunning.txt

Windows Explorer MRU (most recently used) clear search powershell script

This one line powershell script will clear the Windows Explorer MRU (most recently used) search list.

The downloaded zip file also includes both the ps1 script and a compiled exe (executable) version of the script for those who want to run it without launching powershell or if you want to place the exe in your windows start-up folder to clear the search entries each time you start windows.  It works on Vista, Windows 7 or windows 8 and server 2008 or 2012. Getting to your startup folder in Windows 8 or Server 2012 requires browsing to the  location below

C:\Users\<User Profile folder name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Windows Management Framework 3.0 “This update is not applicable to your computer” error

Windows Management Framework 3.0 (Includes PowerShell 3.0, WMI & WinRM for downlevel Win7, 2008, & 2008 R2) is now available here http://www.microsoft.com/en-us/download/details.aspx?id=34595.  For those getting a “This update is not applicable to your computer” error when trying to install it

Update your  Microsoft .Net Framework 4 first. Get it here http://www.microsoft.com/en-us/download/details.aspx?id=17851

After the update the install should complete fine.

Powershell Ping Subnet Gui form

This powershell script with GUI Lets you ping an entire subnet or just a range. Run it by entering .\PingSubnetGuiForm.ps1′or use the compiled executalbe file Ping Subnet Gui Form.exe included in the zip file download to run without having to launch powershell.

  1. Enter the first three octets in the Subnet box
  2. Then enter the start and end range
  3. Adjust any variables and whether to show only pingable and host names,
  4. Press the Ping button.

Be patient pinging an entire subnet can take time, especially if there are many offline systems.

Download Button6

ping subnet gui form

Group Membership Tool – Lets you add , remove or list the members in a group

This powershell script with GUI Lets you add, remove or list local group members on a remote computer. Run it by entering .\’group membership tool with gui.ps1′or use the compiled executalbe file group membership tool with gui.exe included in the zip file download to run without having to launch powershell.

  1. Enter the Computer name to check groups on
  2. Select the group name from the drop-down menu or type one of your own.
  3. Enter the username to add or remove from the groups

Click to download