How to set DNS servers using Powershell

I couldn’t connect to a Windows 2012R2 server that was using NLA for RDP connections because the DNS servers were wrong, and it could not contact a domain controller.

I was able to connect remotely and run Powershell so I used the following command to set the DNS servers. After this I could then RDP in.

Replace the “ethernet 2” with your own interface name (run IPCONFIG to get your ethernet address) and also replace the IP addresses with your own IP addresses.

Set-DnsClientServerAddress -Interfacealias “ethernet 2” -ServerAddresses (“″,””)

Handy commands for Windows server 2016 Core

  1. At a command prompt, type the following:

    netsh interface ipv4 show interfaces

  2. Make a note of the number shown in the Idx column of the output for your network adapter. If your computer has more than one network adapter, make a note of the number corresponding to the network adapter for which you wish to set a static IP address.
  3. At the command prompt, type:

    netsh interface ipv4 set address name=”<ID>” source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>


    ID is the number from step 2 above.

    StaticIP is the static IP address that you are setting.

    SubnetMask is the subnet mask for the IP address.

    DefaultGateway is the default gateway.

  4. At the command prompt, type:

    netsh interface ipv4 add dnsserver name=”<ID>” address=<DNSIP>index=1


    ID is the number from step 2 above.

    DNSIP is the IP address of your DNS server.

  5. Repeat step 4 for each DNS server that you want to set, incrementing the index= number each time.
    1. At a command prompt, type:

      netdom join <ComputerName> /domain:<DomainName> /userd:<UserName> /passwordd:*


      ComputerName is the name of the server that is running the Server Core installation.

      DomainName is the name of the domain to join.

      UserName is a domain user account with permission to join the domain.

    2. When prompted to enter the password, type the password for the domain user account specified by UserName.
    3. If you need to add a domain user account to the local Administrators group, type the following command:

      net localgroup administrators /add <DomainName>\<UserName>

    4. Restart the computer. You can do this by typing the following at a command prompt:

      shutdown /r /t 0

How to remove ghost mailboxes in Outlook 2013

I had some ghost mailboxes in my Outlook 2013 mailbox list. I had full access to these mailboxes, but removed it some time ago, but they are still there. If I click on them and try to remove them, they cannot be removed. I found the link below which had the following instructions which solved the problem. The hardest thing to solve was going through all of the “solutions” that didn’t actually understand the problem.

  1. Open ADSIEdit (WinKey R to open Run and type adsiedit.msc)
  2. Connect to the Default Naming Context. (Click OK)
  3. Locate the mailbox that you once were granted Full Access Permissions and …
  4. Right-click on the object, view properties.
  5. Scroll down to MsExchDelegateListLinked attribute.
  6. Click Edit, select the User Object and click Remove your information.

This link below is where I got the solution

Manually Remove Auto-Mapped Exchange Mailboxes

How to fix the issue when your downloads folder takes a long time to open in Windows

Whenever I would open my downloads folder, it would take about 20 seconds to list the files. It only happened on my downloads folder and it was very frustrating.

To fix it, do the steps below.

  1. Right click your download folder (the actual folder, not the shortcut in favourites)
  2. Go to customize
  3. Select documents from the drop down
  4. If documents was already selected, choose “also apply template to all subfolders”