How to reset trust relationship between computer and a domain

I made a silly mistake and removed my computer from Active Directory. Result? Lost relationship, inability to login and so on. How to resolve it the fastest way?

You have a few options but the worst (and should be your last) is to remove the computer from the domain and rejoin. What is your first option then?

  1. Reset the computer password
    In administrator PowerShell console on the machine that lost trust
    $creds = Get-Credential #use domain\<username>
    Reset-ComputerMachinePassword -Credential $creds -Server <servername> #use PDC or the closest writable DC
  2. Create new computer in Active Directory
    In my case, I had to recreate new computer in Active Directory and then use commands from #1 to reset the password. Worked like a charm
  3. Remove from domain and rejoin
    Not the ideal option but sometimes the only one you have.

If you cannot login or elevate as an administrator, try resetting the local admin password first.

Installing Active Directory on Windows Server Core

Installing Active Directory on Server Core can be intimidating as it’s PowerShell/command prompt only.

Installing Active Directory on Server 2016 Core

  1. Rename server
  2. Set static IP address on the DC
  3. Set DNS on the DC and the client
  4. Install tools
  5. Create new forest (domain)
  6. Add computer
  7. Install tool for remote management

DOMAIN CONTROLLER

Rename-Computer DC01-2016
$ipaddress = "192.168.1.70"
$dnsaddress = "127.0.0.1" #localhost
$ethernet = Get-NetAdapter
Get-DnsClientServerAddress #type those below

New-NetIPAddress -InterfaceAlias $ethernet.name -IPAddress $ipaddress -AddressFamily IPv4 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias $ethernet.name -ServerAddresses ("$dnsaddress","192.168.1.252","192.168.1.1")

#Install AD Domain Services and DNS

Install-WindowsFeature ad-domain-services -IncludeManagementTools

#Create domain

Install-ADDSForest -DomainName testlab.com -InstallDNS -DomainNetbiosName "TESTLAB"

#set recovery password - make sure you save it and keep it safe!

#answer A to allow auto reboot

#reboot

CLIENT

$dnsserver = "192.168.1.70"
$ethernet = Get-NetAdapter
#Get-DnsClientServerAddress #type those below

Set-DnsClientServerAddress -InterfaceAlias $ethernet.name -ServerAddresses ("$dnsserver","192.168.1.252","192.168.1.1")

Rename-Computer WIN10-01

#restart
shutdown -r -t 0

#ADD computer to the domain

Add-Computer -DomainName "testlab.com" -Restart

Login to the domain on the client PC

Download admin tools
https://www.microsoft.com/en-au/download/details.aspx?id=45520

Connect to the remote PowerShell

Enter-PSSession -ComputerName DC01-2016
How to quick parts in outlook feature

How to file and forward with quick steps in Outlook

Have you ever notice that little bar in the middle of your Outlook ribbon and wondered what heck is it good for? By default probably not that much for but little tweaking and you can use it for quite a few things! If you get lot of same emails that require constantly similar action, you can help yourself by creating actions that will do most of it for you. I do not aim for ‘zero email mailbox’ as I think it is a waste of time but I do like to file certain emails from clients, vendors and so on so they are all in one place. Learn how to make your life easier by creating quick part that will forward and file your email in one click!

Check the 20 seconds video tutorial below!

How to quick parts in outlook feature

Read more

How to deal with scammers?

No-one enjoys scammers. They waste your time and although you might have the street smarts not to get caught and pay for their phony fines, not everyone does and many people do end up paying thousands of dollars and in turn perpetuating this ‘business’.

After receiving a phony IRS call, this user called back as they asked him to, with a twist. He created a small script that opens up multiple lines at the time thus prevents them from scamming users.

Enjoy their frustration here