Get Disk Space using PowerShell

Run the following script:

Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = '3'" | Select-Object -Property DeviceID, DriveType, VolumeName, @{L='FreeSpaceGB';E={"{0:N2}" -f ($_.FreeSpace /1GB)}}, @{L="Capacity";E={"{0:N2}" -f ($_.Size/1GB)}}

How to set Service recovery options via PowerShell

Run this function, then run the new Cmd-let that it creates. Replace the server name with the one you want to set the settings for. Replace the Service name with the Display name of the service you want to set.

  1. function Set-ServiceRecovery{
  2. [alias('Set-Recovery')]
  3. param
  4. (
  5. [string] [Parameter(Mandatory=$true)] $ServiceDisplayName,
  6. [string] [Parameter(Mandatory=$true)] $Server,
  7. [string] $action1 = "restart",
  8. [int] $time1 = 30000, # in miliseconds
  9. [string] $action2 = "restart",
  10. [int] $time2 = 30000, # in miliseconds
  11. [string] $actionLast = "restart",
  12. [int] $timeLast = 30000, # in miliseconds
  13. [int] $resetCounter = 4000 # in seconds
  14. )
  15. $serverPath = "\\" + $server
  16. $services = Get-CimInstance -ClassName 'Win32_Service' -ComputerName $Server| Where-Object {$_.DisplayName -imatch $ServiceDisplayName}
  17. $action = $action1+"/"+$time1+"/"+$action2+"/"+$time2+"/"+$actionLast+"/"+$timeLast
  18. foreach ($service in $services){
  19. #
  20. $output = sc.exe $serverPath failure $($service.Name) actions= $action reset= $resetCounter
  21. }
  22. }
  23. Set-ServiceRecovery -ServiceDisplayName "My Service" -Server "PHOSTA"

Enabling Switch Embedded Teaming (SET) on Server 2016

What is Switch Embedded Teaming?

SET is basically a new and better version of NIC teams. The advantage of using a SET is that it provides better data transfer performance as the NICs to no have to send the data they send and receive via the CPU of the server, instead the data accesses the servers memory directly and passes straight through to the other NIC. These NICs can be made into Hyper-V switches to be used with virtual machines.

To enable Switch embedded teaming you need to have Remote Direct Memory Access enabled network cards. To see if you have RDMA enabled NICs run this cmdlet in PowerShell.


If you have RDMA enabled NICs you can create a Hyper-V switch with them with this command:

New-VMSwitch -Name SETvSwitch -NetAdapterName "NIC1","NIC2" -EnableEmbeddedTeaming $True

Once complete, you'll be able to select this new vSwitch as an adapter in Hyper-V. This will provide failover and load balencing at a higher performance than NIC Teaming. 

Outlook wont start -Error Event 1000 - Faulting module path: C:\WINDOWS\System32\ucrtbase.dll


 Outlook won't start. It may or may not start in safe mode. You get event ID Error 1000 when trying to start outlook. 




Backup these reg keys, then delete them:

  • Delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\CurrentSkuIdForApp - Whole Folder/Key

  • Delete HKCU\Software\Microsoft\Office\16.0\Common\Experiment - Whole Folder/Key

  • Delete HKCU\Software\Microsoft\Office\16.0\Common\ExperimentEcs - Whole Folder/Key

  • Delete HKCU\Software\Microsoft\Office\16.0\Common\ExperimentTas - Whole Folder/Key

Unable to install windows 7 | Unable to load drivers when installing windows 7

I recently faced this issue with two Dell Latitude 3570's.

On installing windows, your unable to continue because there are insufficient disk drivers. The problem is actually not this; the problem is that the laptop's disk connected via the USB 3.0 internally, and Windows 7 does not have the drivers for this. On top of that, the laptop does not have a built-in CD drive, so you have to use a bootable USB or usb CD rom drive to mount media.

To resolve this you need to create a Windows 7 USB with an injected USB 3.0 driver in both the boot.wim and install.wim.

Step 1: Download the USB Drivers

Step 2: Extract the drivers

1. Create a folder on your desktop named 'USB3'. 
2. Create two folders inside of the 'USB3' folder, 'mount' and 'USB'. 
3. Extract or copy/paste the driver files directly into the 'USB' folder. I used 7-zip to extract my driver files directly into the 'USB' folder.

Step 3: Copy the 'boot.wim' and 'install.wim' files from install media

Locate these two files from within your boot media.  They are usually located in [Drive]:\sources

Step 4: Open up CMD prompt as Administrator and navigate to the 'USB3' folder on the desktop

Windows 7: 
1. Start, type in cmd, right click on the icon and choose Run as Administrator 
Windows 8: 
1. Windows Key + Q 
2. Move mouse to top right corner and search, type in Command Prompt, Right click and Run as Administrator.

Next, you will need to change the directory path so that it isn't pointing to the default of C:\Windows\System32.

Type in: cd C:\Users\%userprofile%\Desktop\USB3 - Then press Enter. 
*Note: Make sure to change the %userprofile% to that of the user profile where the 'USB3' folder was saved.

Step 5: Update the 'boot.wim' file.

In the cmd run each of these commands.

dism /mount-wim /wimfile:boot.wim /index:2 /mountdir:mount 
This command mounts the boot.wim file, index points it to the correct boot parameters for the correct OS, and /mountdir:mount points it to mount the file to the 'mount' folder we created in this directory earlier.

dism /image:mount /add-driver:"USB" /recurse 
This command automatically grabs the driver files that it locates in the 'USB' folder that we created earlier and copied the drivers to. This can take a while depending on the number of driver files that it locates.

dism /unmount-wim /mountdir:mount /commit 
Be sure to have all windows explorer windows closed before unmounting, otherwise you will get an error saying the files are in use.

Step 6: Find the index you're going to update the driver files for on the 'install.wim' file


Run this command and identify the index number of the edition of windows you are installing.

dism /Get-WimInfo /WimFile:install.wim

Step 7: Update the 'install.wim' file.

Next, mount the main install.wim file:

dism /mount-wim /wimfile:install.wim /index:1 /mountdir:mount 
dism /image:mount /add-driver:"USB" /recurse

Then unmount. 

dism /unmount-wim /mountdir:mount /commit

Step 8: Cut/Paste or Copy/Paste your new 'boot.wim' and 'install.wim' files


Paste the install.wim and boot.wim back into the install media. You will either need to re-burn the DVD or create an ISO and burn to USB (I recommend ISO2USB).