Thursday, May 23, 2013

Name resolution and connectivity issues on a RRAS that also runs DC, DNS or WINS

To fix these problems do the following:
Configure the RRAS server to publish only the IP address of the local network adapter in DNS
If the Routing and Remote Access server is running the DNS service, you may Configure the RRAS server to publish only the IP address of the local network adapter in DNS.
To add the PublishAddresses and RegisterDnsARecords registry values for the DNS and Netlogon services, follow these steps:
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
3. On the Edit menu, point to New, and then click String Value to add the following registry value:
Value name: PublishAddresses
Data type: REG_SZ
Value data: IP address of the server's local network adapter.

If you have to specify more than one IP address, separate the addresses with spaces.
4. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
5. On the Edit menu, point to New, and then click DWORD Value to add the following registry value:
Value name: RegisterDnsARecords
Data type: REG_DWORD
Value data: 0

6. Close Registry Editor, and then restart the DNS and Netlogon services. To restart a service, click Start, point to Programs or All Programs, point to Administrative Tools, and then click Services. In the Services console, right-click the service, and then click Restart.

Configure the RRAS to register only the IP address of the local network adapter in WINS
If the Routing and Remote Access server is running the WINS service, you may configure the RRAS to register only the IP address of the local network adapter in WINS.
To do that, add the DisableNetbiosOverTcpip registry value for the Routing and Remote Access service. The DisableNetbiosOverTcpip registry value disables the NetBIOS over TCP/IP (NetBT) protocol for remote access connections. Therefore, the server will not register the PPP adaptor in the WINS database.
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess\Parameters\IP
3. On the Edit menu, point to New, and then click DWORD Value to add the following registry value:
Value name: DisableNetbiosOverTcpip
Data type: REG_DWORD
Value data: 1

4. Close Registry Editor, and then restart the Routing and Remote Access service. To restart a service, click Start, point to Programs or All Programs, point to Administrative Tools, and then click Services. In the Services console, right-click the service, and then click Restart.

Prevent the DNS Register A Records for RRAS
The DNS Server service registers A Records for all interfaces on a server running Routing and Remote Access. That may cause a master browser and connection issues if the server is domain controller.
To prevent this behavior, you may configure the DNS to prevent the DNS register A Record for the RRAS by follow these steps:
1. Start DNS Manager.
2. Right-click the computer name, and then click Properties.
3. Click the Interfaces tab, and then click Only the following IP addresses.
4. Remove any Routing and Remote Access IP addresses that are listed
For more information take a look at this link.

Tuesday, April 23, 2013

How to test and reset the secure channel between a computer and a domain

We can use the domain secure channel utility nltest.exe as follows:
To test the secure channel use the following command:
nltest /server:<ComputerName> /sc_query:<DomainName>
To reset the secure channel use the following command:
nltest /server:<ComputerName> /sc_reset:<DomainName>
Another option is to use the netdom command to reset the secure channel using the command:
netdom reset <ComputerName> /Domain <DomainName> /UserO <UserUPN> /PasswordO * 
For more information read the following articles from Microsoft KB:
http://support.microsoft.com/kb/158148
http://support.microsoft.com/kb/216393

Wednesday, March 13, 2013

PXE-E55: ProxyDHCP service did not reply to request on port 4011

We you try to PXE boot a client from WDS you receive the message:
PXE-E55: ProxyDHCP service did not reply to request on port 4011
To fix this problem open a command prompt in WDS server and enter the following command:
WDSUTIL /Delete-AutoAddDevices /DeviceType:ApprovedDevices

Friday, February 1, 2013

How to upgrade Windows Server 2008 R2 from Standard to Enterprise Edition without media

Open a command prompt and enter the command:
DISM /online /Get-CurrentEdition
to find the current server edition.
After that enter the command:
DISM /online /Get-TargetEditions
to find the editions that your system can be upgraded to.
Finally enter the command
DISM /online /Set-Edition:ServerEnterprise /ProductKey:XXXX-XXXX-XXXX-XXXX-XXXX
to upgrade to enterprise version. Of course you must use your real enterprise product key.
If you have a KMS to activate your windows server then you can use the known KMS client key, so the command becomes:
DISM /online /Set-Edition:ServerEnterprise /ProductKey:489J6-VHDMP-X63PK-3K798-CPX3Y
For more information read the following article.
There is a possibility that after this upgrade procedure the system does not allow you to use memory above 4 GB and the allow remote desktop check box is disabled. In this case use the following procedure to fix this problem:
Open a command prompt
Type slmgr.vbs -ckms (this clears any KMS entry you have)
Type slmgr.vbs -upk (this removes any product key installed)
Type slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx (where the x’s is the new enterprise product key you will use)
Type slmgr.vbs -ato (this activates the server)
After this you must restart the server, so that you can utilize memory above 4 GB and to enable remote desktop check box in system properties.

How to convert a Windows Server 2012 Core to a Windows Server 2012 GUI installation

From the command line we start powershell:
start powershell
Optionally we set a system proxy if we don't have a direct internet connection:
netsh winhttp set proxy proxy.company.com:3128
Then we enter this command so that the actual conversion take place:
Install-WindowsFeature server-gui-mgmt-infra,server-gui-shell
If we can't access the install files from the Internet  then we can use the installation dvd:
Insert installation dvd to the drive and enter the command
Get-WindowsImage -ImagePath D:\Sources\Install.wim
where D: is the dvd drive letter
From there we find the index number of the windows server installation image we have. Using this information we can enter the command
Install-WindowsFeature server-gui-mgmt-infra,server-gui-shell -Source wim:d:\sources\install.wim:2
where 2 is the index number of the installation image we have on our server.
Finally we must restart our server using the powershell command
Restart-Computer
After the restart our server becomes a full gui installation.
To reset the proxy server settings we must enter the command
netsh winhttp reset proxy

Thursday, January 31, 2013

How to safely remove a USB disk from a windows server core installation

  • On command prompt type "diskpart" and wait for the next prompt and then type "list volume". Take note of the number of your desired volume by watching its drive letter
  • Type "select volume x", where x is the number of your USB storage.
  • Then type "remove all dismount". 
  • Type "exit" to leave diskpart.

Wednesday, January 30, 2013

How to show Windows Update dialog in Windows 8

From a command line or from Run dialog box (Windows Key + R) enter this command
wuauclt /ShowWU

Tuesday, January 29, 2013

How to change your MTU size under Vista or Windows 7

  • Find your MTU
From an elevated command prompt enter the following command:

netsh interface ipv4 show subinterfaces

  • Find out what it should be
ping www.google.com -f -l 1472

The host name should be a site you can not reach, -f denotes that icmp packets should not be fragmented, the -l 1472 sets the size of the packet (1472 = Ethernet Default MTU – Packet Header, where the Ethernet Default MTU is 1500 and the Packet Header is 28 bytes).
If the packet can’t be sent because it would need to be fragmented you will get something similar to this:

Packet needs to be fragmented but DF set.

Keep trying lowering packet sizes by 10 (i.e. -l 1460, 1450, 1440, etc.) until you get a successful ping request. Raise your packet sizes by one until you get a "Packet needs to be fragmented but DF set.". The last successful value plus 28 will be your MTU value.
In my case a packet size of 1464 succeeds but 1463 fails, so 1464 + 28 = 1492.

  • Set your MTU
netsh interface ipv4 set subinterface "Local Area Connection" mtu=1492 store=persistent

For more information you can read the following link.

Monday, January 28, 2013

How to remove the icon "Safely remove hardware" from the statusbar of a VM

  • Power off the virtual machine
  • Open "Edit settings"
  • Select the "Options" Tab
  • Select "General" –-> "Configuration Parameters"
  • Click "Add Row"
  • Add a field named: devices.hotplug with value: FALSE
  • Power on VM
For more information read the article Remove the icon "Safely remove hardware"

Monday, January 21, 2013

How to reset root password in ESXi 4.x & 5.x

This guide is unsupported from VMware, so do it on your own risk.
First download a live Linux boot CD. In my case I downloaded Knoppix.
Then you can burn the ISO to make a bootable cdrom or use a tool like Live Linux USB Creator to make a bootable Linux USB stick.
Boot with above Linux boot CD or USB and enter
# fdisk -l
to find the disks resident on the server.
Find the partition holding the file state.tgz and mount it. In my case it was /dev/sdb5 so I used the commands:
# mkdir /mnt/disk
# mount /dev/sdb5 /mnt/disk
# cd /mnt/disk
# ls -al
# cp state.tgz state.tgz.bak
# cd /ramdisk
# mkdir temp
# cd temp
# tar zxf /mnt/disk/state.tgz
# ls -al
# tar zxf local.tgz
# cd etc
# vi shadow

Use the above command to edit the shadow file holding the root password.
Delete all characters between the first and second : character so that you erase the root password.
Write back the shadow file and quit vi using the command :wq
Finally put everything back using the commands:
# cd ..
# rm -rf local.tgz
# tar zcf local.tgz *
# chmod 755 local.tgz
# rm -rf /mnt/disk/state.tgz
# tar zcf /mnt/disk/state.tgz local.tgz
# ls -al /mnt/disk/
# umount /mnt/disk
# shutdown -r now

Friday, January 11, 2013

How to install Dell OpenManage Administrator in Linux CentOS 6.3

Edit /etc/yum.conf and ensure that exist the line
plugins=1
If not then create or amend that line so that it looks as above
Setup the Dell OpenManage  repository using the command
wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
Install Dell OpenManage Administrator using the command
yum install srvadmin-all
If you only want to install Dell OpenManager Web Interface and not the full package then use the command
yum install srvadmin-webserver
instead of the previous one

Thursday, January 3, 2013

How to install .NET Framework 3.5 in Windows 8

In Windows 8 or Windows Server 2012, open a Command Prompt window with administrative credentials (that is, choose Run as administrator).
To install the .NET Framework 3.5 from installation media located in the D:\sources\sxs directory, use the following command:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
Use /All to enable all parent features of the .NET Framework 3.5.
Use /LimitAccess to prevent DISM from contacting Windows Update.
Use /Source to specify the location of the files needed to restore the feature.

Thursday, November 1, 2012

How to check partition alignment for a windows machine

Open a command line and enter the command
wmic partition get BlockSize, StartingOffset, Name, Index
If StartingOffset is 1048576 then you have an aligned partition. If you see a value like 32256 then you have an alignment problem.

Monday, October 22, 2012

How to format a log in Forefront Protection

Open a command prompt and change folder to the Forefront Program files folder. By default this should be "C:\Program Files (x86)\Microsoft Forefront Protection for Exchange Server"
Next run the following command:
fsctraceformat.exe .\data\programlog.etl –p .\data\tmf –o .\data\programlog.txt
The log file is created in data subfolder and you can open it with any text editor like notepad.

Friday, August 10, 2012

How to convert a full server 2012 to a core installation

To convert a full operating system installation to a server core installation using dism
Dism /online /disable-feature /featurename:ServerCore-FullServer
To convert a full operating system installation to a server core installation using powershell
Disable-WindowsOptionalFeature -online -Featurename Servercore-Fullserver
To convert a server core installation back to a full operating system installation using dism
Dism /online /enable-feature /featurename:Server-Gui-Mgmt /featurename:Server-Gui-Shell /featurename:ServerCore-FullServer
To convert a server core installation back to a full operating system installation using powershell
Enable-WindowsOptionalFeature -online -Featurename Servercore-FullServer,Server-Gui-shell,Server-Gui-MgmtFor servers with server core as the base installation perform the following steps to convert to a full operating system installation
Create an folder called C:\ws12\image
Insert the Windows 2012 media into the optical drive and type :
Copy install.wim from D:\sources\install.wim to C:\ws12\image
Run the following command to retrieve the name or index number of the image:
Dism /Get-ImageInfo /ImageFile:C:\ws12\image\install.wim
Run the following command to mount the offline Windows image (Note: index:2 = Standard Edition index:4 = Datacenter Edition) :
Dism /Mount-Image /ImageFile:C:\ws12\image\install.wim /index:2 /MountDir:C:\ws12\MountPoint
Upgrade the operating system by running the command:
Dism /online /enable-feature /featurename:Server-Gui-Mgmt /featurename:Server-Gui-Shell featurename:ServerCore-FullServer /source:c:\ws12\MountPoint\windows\winsxs
Run the following command to convert a full operating system installation back to a server core installation:
Dism /online /disable-feature /featurename:ServerCore-FullServer
For more information read this post.

Wednesday, August 8, 2012

How to enable remoting in a windows server 2012 core

From a command line on the server machine enter
winrm qc
Press y to continue
If the server is not a domain member you can remotely manage it from a workstation adding workstation's ip in wsman trusted hosts using the command:
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the workstation machine
In the workstation machine enable winrm using the command
winrm qc
and
winrm set winrm/config/client @{TrustedHosts="x.x.x.x"}
where x.x.x.x is the IP address or the computer name of the server machine
After that you can connect to the remote machine using the command
winrs -r:http://x.x.x.x:5985 -u:username "command"
where x.x.x.x is the IP address or the computer name of the server machine, username a user with admin persmissions on the server machine and command the command to execute on the server machine.
Example:
winrs -r:http://192.168.10.10:5985 -u:Administrator "cmd"
For more information take a look at the following post

How to rename the local Administrator account in server core

Enter this command to rename local Administrator account to a new name:
wmic UserAccount where Name="Administrator" call Rename Name="new-name"

In Windows Server 2012 Core we can utilize Powershell, so to find the Local Administrator account name we use the following command:
gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}
In order to rename the Local Administrator account to another name we use the following command:
(gwmi Win32_UserAccount | ? {$_.SID -Like 'S-1-5-*-500'}).Rename("New-Name")

Friday, July 20, 2012

Linux 2.6 kernel-based virtual machines experience slow disk I/O performance in ESXi

As of the Linux 2.6 kernel, the default I/O Scheduler is Completely Fair Queuing (CFQ). The scheduler is an effective solution for nearly all workloads.
With the release of Linux 2.6, the kernel has these schedulers as configurable options:
Completely Fair Queuing (cfq): CFQ is the default under many Linux distributions. CFQ places synchronous requests submitted by processes into a number of per-process queues and then allocates time slices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit depends on the I/O priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority.
NOOP (noop): NOOP is the simplest I/O scheduler for the Linux kernel based upon the FIFO queue concept. The NOOP scheduler inserts all incoming I/O requests into a simple FIFO queue and implements request merging. The scheduler assumes I/O performance optimization will be handled at some other layer of the I/O hierarchy.
Anticipatory (anticipatory): Anticipatory is an algorithm for scheduling hard disk I/O. It seeks to increase the efficiency of disk utilization by "anticipating" synchronous read operations.
Deadline (deadline): The goal of the Deadline scheduler is to guarantee a start service time for a request. It does this by imposing a deadline on all I/O operations to prevent starvation of requests.
The default scheduler will affect all disk I/O for VMDK and RDM-based virtual storage solutions. In virtualized environments, it is often not beneficial to schedule I/O at both the host and guest layers. If multiple guests use storage on a filesystem or block device managed by the host operating system, the host may be able to schedule I/O more efficiently because it is aware of requests from all guests and knows the physical layout of storage, which may not map linearly to the guests' virtual storage.
Testing has shown that NOOP or Deadline perform better for virtualized Linux guests. ESX uses an asynchronous intelligent I/O scheduler, and for this reason virtual guests should see improved performance by allowing ESX to handle I/O scheduling.
To implement this change, please refer to the documentation for your Linux distribution.
Note: All scheduler tuning should be tested under normal operating conditions as synthetic benchmarks typically do not accurately compare performance of systems using shared resources in virtual environments.
For example, this change can be implemented by:
The scheduler can be set for each hard disk unit. To check which scheduler is being used for particular drive, run this command:
cat /sys/block/disk/queue/scheduler
For example, to check the current I/O scheduler for sda:
# cat /sys/block/sda/queue/scheduler
[noop] anticipatory deadline cfq
In this example, the sda drive scheduler is set to NOOP.
To change the scheduler on a running system, run this command:
# echo scheduler > /sys/block/disk/queue/scheduler
For example, to set the sda I/O scheduler to NOOP:
# echo noop > /sys/block/sda/queue/scheduler
Note: This command will not change the scheduler permanently. The scheduler will be reset to the default on reboot. To make the system use a specific scheduler by default, add an elevator parameter to the default kernel entry in the GRUB boot loader menu.lst file.
For example, to make NOOP the default scheduler for the system, the /boot/grub/menu.lst kernel entry would look like this:
title CentOS (2.6.18-128.4.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.4.1.el5 ro root=/dev/VolGroup00/LogVol00 elevator=noop
initrd /initrd-2.6.18-128.4.1.el5.img
With the elevator parameter in place, the system will set the I/O scheduler to the one specified on every boot.

Tuesday, July 17, 2012

How to activate cdp and lldp in a vSwitch in ESXi

From esxcli
to activate both in vSwitch0 enter:
esxcli network vswitch standard set -c both -v vSwitch0
to list cdp and lldp status enter:
esxcli network vswitch standard list -v vSwitch0