Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, November 5, 2015

Changing the case of a Windows hostname

Naming convention is something that I’m very particular about and one thing that has always bugged me is if hostnames are not the same case.  In the Windows world there is no functional difference between upper and lowercase hostname, but it’s still enough to bother me.

To change the case is surprisingly easy.

First we log onto “Active Directory Users and Computers” and enable the “Advanced Features” which lives in the View menu.

image

Double-click the offending hostname and go to the “Attribute Editor”.  Scroll down to the dNSHostName and change the case.

image

The change will take effect as soon as you reboot the host in question.

Wednesday, July 17, 2013

Handy WMI GPO filters

I thought I’d document a couple of WMI filters I’ve found handy when deploying software via Group Policy Objects (GPOs).  Windows Management Instrumentation (WMI) filters allow you to dynamically determine the scope of GPO based on attributes of the target computer.

When a GPO that is linked to a WMI filter is applied on the target computer, the filter is evaluated on the target computer. If the WMI filter evaluates to false, the GPO is not applied (except if the client computer is running Windows 2000, in which case the filter is ignored and the GPO is always applied). If the WMI filter evaluates to true, the GPO is applied.

Target Windows 7 32-bit machines

select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND NOT OSArchitecture = "64-bit"

Target Windows 7 64-bit machines:

select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND OSArchitecture = "64-bit"

Target any 32-bit OS:

SELECT AddressWidth FROM Win32_Processor WHERE AddressWidth ='32'

Target any 64-bit OS:

SELECT AddressWidth FROM Win32_Processor WHERE AddressWidth ='64'

Target Windows 7, Vista, Server 2008, Server 2008 R2 

select * from Win32_OperatingSystem where Version like "6.%" '

Target Windows 7, Server 2008 R2

select * from Win32_OperatingSystem where Version like "6.1%" '

Target Windows Server 2003

select * from Win32_OperatingSystem where Version like "5.2%" '

Target Server 2003, but not domain controllers

select * from Win32_OperatingSystem where Version like "5.2%" and ProductType="3" '

Target Server 2008 and 2008 R2, but not domain controllers

select * from Win32_OperatingSystem where Version like "6.%" and ProductType="3" '

Note:  Substitute ProductType="3" ' with ProductType="2" ' to just target domain controllers.

Sunday, February 12, 2012

Synching a Windows AD domain with an external time source

Having your time set up correctly is of crucial importance to the well-being of your Active Directory infrastructure.  In every setup I do I ensure that my PDC Emulator FSMO holder synchs with an NTP server on the internet.  Unless there are specific customer requirements I use pool.ntp.org as my external source.  Here is how to configure your PDC Emulator to sync (all commands entered from an Administrative Command Prompt):

  1. Ensure that your firewall allows outbound NTP traffic from your PDC emulator
  2. Run w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL /update
  3. Restart the time service: net stop w32time && net start w32time
  4. Force a synchronization with the newly added source: w32tm /resync
  5. Verify the source: w32tm /query /source

The rest of your domain clients should automatically synchronise with your PDC emulator.  If this has been changed for whatever reason you can re-instate it with the following commands:

  1. w32tm /config /update /syncfromflags:DOMHIER
  2. net stop w32time && net start w32time
  3. w32tm /query /status

The above will go a long way to giving you a proper time-setup, and should be sufficient and accurate enough for most organisations