martes, 2 de julio de 2013

The trust relationship between this workstation and the primary domain failed

DON'T REJOIN TO FIX


If you Google “the trust relationship between this workstation and the primary domain failed”, you get plenty of information from support blogs and Microsoft articles; however, most of them ask you to rejoin your machine to the domain. That’s not always possible.


The underlying problem when you see this error is that the machine you are trying to access can no longer communicate securely with the Active Directory domain to which it is joined.  The machine’s private secret is not set to the same value store in the domain controller.  You can think of this secret as a password but really it’s some bits of cryptographic data called a Kerberos keytab stored in the local security authority.  When you try to access this machine using a domain account, it fails to verify the Kerberos ticket you receive from Active Directory against the private secret that it stores locally.  I think you can also come across this error if for some reason the system time on the machine is out of sync with the system time on the domain controller.  This solution also fixes that problem.
This problem can be caused by various circumstances, but I most commonly run into it when I reset a virtual machine to a system snapshot that I made months or even years before.  When the machine is reset, it is missing all of the automatic password changes that it executed against the domain controller during the intervening months.  The password changes are required to maintain the security integrity of the domain.


Support blogs and Microsoft will generally tell you to rejoin the domain to restore the trust relationship.  Another option they will give is to delete the computer object and recreate it without a password and rejoin.
Microsoft support article on the topic: http://support.microsoft.com/kb/162797
I’m not a fan of any of these options.  This seems heavy handed and sometimes they aren’t even possible.
Recently, when I ran into this problem, the virtual machine that reset was an enterprise certificate authority joined to my test domain.  Well, guess what, Microsoft will not allow you to rename or unjoin a computer that is a certificate authority—the button in the computer property page is greyed out.  There may be another way to unjoin but I wasn’t going to waste time on it when it isn’t even necessary.


Just change your computer password using netdom.exe!

netdom.exe resetpwd /s: /ud: /pd:*

= a domain controller in the joined domain

= DOMAIN\User format with rights to change the computer password
Here are the full steps:
  1. You need to be able to get onto the machine. I normally just log in with the local Administrator account by typing, ".\Administrator" in the logon window. I hope you remember the password. If you’re creative and resourceful you can hack your way in without the password. Another option is to unplug the machine from the network and log in with domain user. You will be able to do disconnected authentication, but in the case of a reset machine, remember that you may have to use an old password. Your domain user’s cached credential has the same problem as the machine’s private secret.
  2. You need to make sure you have netdom.exe. Where you get netdom.exe depends on what version of Windows you’re running. Windows Server 2008 and Windows Server 2008 R2 ship with netdom.exe you just have to enable the Active Directory Domain Services role. On Windows Vista and Windows 7 you can get it from the Remote Server Administration Tools (RSAT). Google can help you get them. For other platforms see this link: http://technet.microsoft.com/en-us/library/ee649281(WS.10).aspx"
  3. Extra steps if the machine is a domain controller. If the broken machine is a domain controller it is a little bit more complicated, but still possible to fix the problem. I haven’t done this for a while, but I think this works:
    1. Turn off the Kerberos Key Distribution Center service. You can do this in the Services MMC snap-in. Set the startup type to Manual. Reboot.
    2. Remove the Kerberos ticket cache. A reboot will do this for you, or you can remove them using KerbTray.exe. You can get that tool here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657
    3. Post change steps. Do these in conjunction with 5 below. Turn the Kerberos Key Distribution Center Service back on before rebooting. You should reboot the domain controller and then force replication in the Active Directory Sites and Services MMC snap-in.
  4. Run netdom.exe to change the password.
    1. Open an administrative command prompt. On Windows platforms with UAC enabled, you will need to right-click on cmd.exe and select "run as Administrator".
    2. Type the following command: netdom.exe resetpwd /s: /ud: /pd:*
  5. Reboot the machine.
Here is more information on netdom.exe: http://support.microsoft.com/kb/325850

I hope this is helpful.  This problem comes up every few months for me, so I wanted to document it for my own use.  It is difficult to find when you just search for the error you get in the login window.

martes, 28 de mayo de 2013

Usar el puerto serie de la Raspberry pi para conectarse


Raspberry Pi and the Serial Port

By default the Raspberry Pi’s serial port is configured to be used for console input/output. Whilst this is useful if you want to login using the serial port, it means you can't use the Serial Port in your programs. To be able to use the serial port to connect and talk to other devices (e.g. Arduino), the serial port console login needs to be disabled.
Needless to say you will need some other way to login to the Raspberry Pi, and we suggest doing this over the network using an SSH connection.
Disable Serial Port Login
To enable the serial port for your own use you need to disable login on the port. There are two files that need to be edited
The first and main one is /etc/inittab
This file has the command to enable the login prompt and this needs to be disabled. Edit the file and move to the end of the file. You will see a line similar to
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Disable it by adding a # character to the beginning. Save the file.
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Disable Bootup Info
When the Raspberry Pi boots up, all the bootup information is sent to the serial port. Disabling this bootup information is optional and you may want to leave this enabled as it is sometimes useful to see what is happening at bootup. If you have a device connected (i.e. Arduino) at bootup, it will receive this information over the serial port, so it is up to you to decide whether this is a problem or not.
You can disable it by editing the file /boot/cmdline.txt
The contents of the file look like this
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Remove all references to ttyAMA0 (which is the name of the serial port). The file will now look like this
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Reboot
In order you enable the changes you have made, you will need to reboot the Raspberry Pi
sudo shutdown -r now
Test the Serial Port
A great way to test out the serial port is to use the minicom program. If you dont have this installed run
sudo apt-get install minicom
Connect your PC to the Raspberry Pi serial port using an appropriate serial port adapter and wiring, then open Putty or a similar serial terminal program on PC side. Setup a connection using the serial port at 9600 baud.
Now run up minicom on the Raspberry Pi using
minicom -b 9600 -o -D /dev/ttyAMA0
What you type into the minicom terminal screen should appear on the serial PC terminal and vice versa.


jueves, 2 de mayo de 2013

Activar o cambiar key (serial) Windows 8

Hola,

a alguno ya le abra sucedido lo de instalar un Windows 8 (tal vez la versión empresarial o descargado de la MSDN) y que se queje de que windows no está activado, darle a activar y que no haga practicamente nada.

Esto suele suceder porque la key con la que ha sido instalado el producto no es válido o no la hemos introducido nunca.

Como en Windows 8 no hay boton para decirle "Cambiar la key asignada" pues hacemos lo siguiente.

Abrimos una shell como administradores

Para los que no veais como:

     - os acercais a la esquina donde salen los simbolos como la lupa para buscar
     - le dais a la lupa y escribis cmd
     - pulsais abajo donde pone ejecutar como administrador
2012-08-16_0030_001
Una vez en la ventana le poneis esto:

slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

las XXX deben ser vuestra key.
2012-08-16_0031
Despues de esto ya podremos activar.


Información menos entendible de MS:
http://support.microsoft.com/kb/2750773/es



Información visible en ingles en:
http://www.nextofwindows.com/how-to-change-windows-8-product-key-to-complete-activation/

http://www.mytechguide.org/12976/change-windows-8-key/