21 December 2012

Fix "the trust relationship between this workstation and the primary domain failed" Error


I normally put references for my posts at the end of the post, but because I have shamelessly cut an paste a large chunk of this respectable blogger's page, due to its absolute gold value, I felt I needed to acknowledge them at the beginning.

All thanks for this post must go to Dan Peterson who posted the original info (and background if you wish to read it) at:
http://implbits.com/About/Blog/tabid/78/post/don-t-rejoin-to-fix-the-trust-relationship-between-this-workstation-and-the-primary-domain-failed/Default.aspx

Dan, thank you for the great and valuable post.

Dan's Post (including original font and background colours). I did say shameless...

Just change your computer password using netdom.exe!

netdom.exe resetpwd /s:<server> /ud:<user> /pd:*

<server> = a domain controller in the joined domain

<user> = 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:<server> /ud:<user> /pd:*
  5. Reboot the machine.
Here is more information on netdom.exe: http://support.microsoft.com/kb/325850

References:
http://implbits.com/About/Blog/tabid/78/post/don-t-rejoin-to-fix-the-trust-relationship-between-this-workstation-and-the-primary-domain-failed/Default.aspx
I learnt of Dan's post at http://community.spiceworks.com/topic/285129-my-virtual-nightmare-or-it-would-have-been-if-i-slept?utm_campaign=spotlight&utm_medium=email&utm_source=swemail

18 December 2012

How to Determine SQL Version and Edition

To determine what SQL version and edition you have, connect to the instance of SQL Server, and then run the following query:


SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Also, see here to determine the common name for the version you have: http://sqlserverbuilds.blogspot.co.nz/
Props to the team and community that keep that site updated.

Reference:
http://support.microsoft.com/kb/321185
http://sqlserverbuilds.blogspot.co.nz/


12 December 2012

Run Control Panel Applets from Command Line

   Control panel tool             Command
   -----------------------------------------------------------------
   Accessibility Options          control access.cpl
   Add New Hardware               control sysdm.cpl add new hardware
   Add/Remove Programs            control appwiz.cpl
   Date/Time Properties           control timedate.cpl
   Display Properties             control desk.cpl
   FindFast                       control findfast.cpl
   Fonts Folder                   control fonts
   Internet Properties            control inetcpl.cpl
   Joystick Properties            control joy.cpl
   Keyboard Properties            control main.cpl keyboard
   Microsoft Exchange             control mlcfg32.cpl
      (or Windows Messaging)
   Microsoft Mail Post Office     control wgpocpl.cpl
   Modem Properties               control modem.cpl
   Mouse Properties               control main.cpl
   Multimedia Properties          control mmsys.cpl
   Network Properties             control netcpl.cpl
                                  NOTE: In Windows NT 4.0, Network
                                  properties is Ncpa.cpl, not Netcpl.cpl
   Password Properties            control password.cpl
   PC Card                        control main.cpl pc card (PCMCIA)
   Power Management (Windows 95)  control main.cpl power
   Power Management (Windows 98)  control powercfg.cpl
   Printers Folder                control printers
   Regional Settings              control intl.cpl
   Scanners and Cameras           control sticpl.cpl
   Sound Properties               control mmsys.cpl sounds
   System Properties              control sysdm.cpl



This info is directly sourced from http://support.microsoft.com/kb/192806

07 December 2012

Find A Specific Email Address in Exchange

Sometimes we want to know what mailbox is associated with a particular email address. Here is the easy way to find out.

Exchange 2003
For Exchange 2003, Neil Hobson writes a very good article on www.msexchange.org that makes the process very simple. You must be logged onto a PC or server that has both Active Directory tools and Exchange 2003 management tools installed. See the full article at http://www.msexchange.org/articles/finding-duplicate-smtp-addresses.html

One thing he doesn't specifically mention is that you can use wildcards, such as '*', in your search, which is handy when you don't know the exact address you're looking for.

Exchange 2007/2010
For newer versions of Exchange, simply open the Exchange Management Shell on your mail server and type the following command:
get-recipient emailaddress@domain.com

References
http://www.msexchange.org/articles/finding-duplicate-smtp-addresses.html