Easy way to fix “The trust relationship between this workstation and the primary domain failed”

This happens very often. Usually I was rejoining workstation/server to the domain. However it is easier way to do it.

  1. You have to log in to the server with a broken relationship.
  2. You have to know the name of Domain Controller (example: AD01)
$DomainCred = Get-Credential
Reset-ComputerMachinePassword -Server "AD01" -Credential $DomainCred

That’s all.

How to kill frozen service

Hi Guys,

This happens very often that you are going to services.msc and you want to restart service and after a few seconds, you see that service is hung (grey out).

Step1. Grab the name of the service.

Step2. Get PID of the service.
sc queryex servername

looking for PID

Step3. Kill the PID
taskkill /f /pid [PID]

That’s all, now you can start service in service console.

How to find SID users/groups/computers star from pa*

I had to get SID for all Users that Logon Name begin with pa

Get-ADUser -Filter {Name -like "pa*"} | Select Name,SID | Format-Table -Auto

For all Groups that Name begin with pa

Get-ADGroup -Filter {Name -like "pa*"} | Select Name,SID | Format-Table -Auto

For all Computers that Name begin with pa

Get-ADComputer -Filter {Name -like "pa*"} | Select Name,SID | Format-Table -Auto

How to migration DHCP from Windows Server 2008 to 2012

Today simple tip how to migrate DHCP from Windows Server 2008 to 2012.

  • Log on to the old/existing DHCP server.
  • Click Start, click Run, type cmd in the Open box, right-click, and then “Run as Administrator”.
  • Type netsh dhcp server export C:\Users\Desktop\dhcp.txt all , and then press ENTER.
  • Install the DHCP role on the new (2012) DHCP server using Server Manager.
  • Copy the exported DHCP text file to the desktop of the new DHCP server.
  • Verify that the DHCP service is installed and started on the new DHCP server.
  • Click Start, click Run, type cmd in the Open box, right-click, and then “Run as Administrator”.
  • Type netsh dhcp server import C:\Users\Desktop\dhcp.txt all , and then press ENTER
  • Open DHCP console on the new server.
  • In the console tree, right-click DHCP.
  • Select “Authorize”.

That’s all folks.

Windows Explorer is not recognizing correct space of the disk after extended it in the Disk Manager

Hi guys,

Today I am going to describe problem which happens very often on the virtual Windows machines, however I have seen people complying about this problem on the physical servers.

Problem: Windows is not recognizing correct space of the disk after extended it in the Disk Manager.
Than you noticed that yours disk needs more space, after extended space of the virtual disk in the Hyper-v you went to the disk manager and extend the disk. However Windows is still not recognizing space which you just added it.

Extended disk size

Easy fix it for this.
Go to command prompt and enter the following commands:


C:\DISKPART
C:\DISKPART>List Volume
C:\DISKPART>select volume # (select volume which has problem with recognizing space)
C:\DISKPART>extend filesystem
C:\DISKPART>exit

Screenshot 2016-01-18 10.10.27

That’s all.

Good luck.

How to fix problem when your hard drive became RAW.

Few days ago my boss asked me to check one hard drive. I was able to get everything. However next time when we connected this hard drive windows asked us to format it (RAW ).

This is how I fixed it.

  1. Go to Disk Management .
  2. Right click on problematic partition and chose option Change Drive Letter and Paths.
  3. Click add if partition is not mounted.
  4. Change letter for example X.
  5. Go to RUN.
  6. Type CMD.
  7. Type chkdsk X: /f
  8. Chkdsk should report some issues and fix them 🙂

That’s all folks.

How to Activate/Deactivate Windows from command line.

Sometimes Windows has problem with activation. We can  easy solve this problem from command line.

Activation Windows from Command Line:

Find CMD and “Run as administrator”

Type:  slmgr -ipk your-mak-key-here

If everything went well you will see this windows

Windows Activation Success

Type:  slmgr -ato

Activation Windows

 

Deactivation Windows from Command Line:

Find CMD and “Run as administrator”.

Type: slmgr -upk

If everything went well you will see this window.

Unninstalled product key

Now your Windows installation is fully genuine.

How to Cancel or Delete a Stuck Print Job in the Windows

Problem Stuck Job Print.

Probably everyone who has printer experienced problem with stuck documents in queue. This is my solution how to fix this problem.

Solution1:

  1. Open Services.
  2. Find and stop Service Print Spooler.
  3. Open RUN and past %windir%\System32\spool\PRINTERS
  4. Delete all files in this folder.
  5. Open Services and start Service Print Spooler.
  6. Enjoy your printing.

Solution2:

Also which I strongly recommended you can use simple script which can do it for you automatically.

  1. Open Notepad.
  2. Copy text bellow.
    @echo off
    echo Cleaning the the print spooler
    net stop spooler
    echo Removing documents in the print queue
    del /q /f /s "%systemroot%\system32\spool\PRINTERS\*.*"
    net start spooler
    echo All DONE!!
    pause
  3. Save the file and give good easy name like clean_printer_spooler.bat
  4. Right click on script and “Run as administrator”
  5. Save your script in save place and use always when you have a problem.