Raj2796's Blog

October 10, 2012

Windows 2008 R2 64 clearing all event logs via powershell

Filed under: MS — raj2796 @ 11:34 am

Quick post – some of my virtual servers amassed massive event logs that were using up valuable space, a quick way to clear all event logs on the server from  powershell is to use the command:

wevtutil el | foreach { wevtutil cl $_ }

September 28, 2011

Windows Symbolic links, Hard links, Junctions and problem accessing remotely

Filed under: MS — raj2796 @ 11:03 am

Microsoft has once again implemented more features from rival os’s, which can only be a good thing since in this case it’s Linux. Symbolic links, hard links and junctions can now be created in windows via the mklink command, older OS’s e.g. XP need to download the resource pack and grab linkd

USAGE

Mklink – vista/windows 7/ windows 2008 / windows 8

There are 3 options for mklink

  • Symbolic links – selected via the /D flag – these are like short cuts – a symbolic link to a directory is created, the default is a file symbolic link . For those of us from Linux think softlink
  • Hard link – selected via the /H flag – only for files – if you delete the hard link you delete the actual file as opposed to symbolic links where you just delete the link to the file
  • Junction – selected via the /J flag – created a directory junction i.e. hard link to a directory
For example, if you want to create a symbolic link from your appv content directory e.g. c:\AppV\content to a dev directory e.g. c:\AppV\dev you would type:
mklink /D c:\Appv\content\dev c:\Appv\dev
as shown in the below image
Linkd - only on older machines such as XP, mklink is far better

LINKD Link [/D] Target

REMOTE ACCESS TO LINKS

I suggest using a junction, they work remotely by default, however if you need to access a symbolic link remotely you can by editing the symbolic link evaluation. MS explain this on technet here – the relevant part being:

Evaluations. A user can enable or disable any of the four evaluations that are available in symbolic links. The available evaluations are:

  • Local-to-local describes a computer accessing a local symbolic link that points to a local file or folder.
  • Local-to-remote is a computer accessing a local symbolic link that points to a Universal Naming Convention (UNC) path using the server message block (SMB) protocol.
  • Remote-to-local is a computer accessing a remote symbolic link that points to a local file or folder using SMB.
  • Remote-to-remote describes a computer accessing a remote symbolic link that points to a remote UNC path using SMB.
to allow all use the command :
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
e.g:

January 25, 2011

VMware Template renames network adaptor when deploying windows 7 or windows 2008 R2

Filed under: MS,vmware — raj2796 @ 10:40 am

This caught me out for a while and I originally thought i had made a mistake in creating my templates, however it appears this is a known issue with VMware, from the VMware knowledge base :

Deploying Windows 2008 R2 and Windows 7 templates with vmxnet3 renames the NIC as #2

Symptoms
When deploying virtual machines from a Windows 2008 R2 or Windows 7 template configured with the vmxnet3 Ethernet device, the resulting virtual machine’s guest operating system shows the Ethernet adapter as:

VMXNET Device #2 in Device Manager
Local Area connection #2 in Network Properties

Resolution
This issue occurs when virtual adapter VMXNET3 is used.
To workaround this issue, try one of these options:

  • Use E1000 virtual network cards in Windows 2008 R2 and Windows 7 templates.
  • Apply the Microsoft hotfix for this issue. For more information, see the Microsoft Knowledge Base article 2344941.

This hotfix may resolve issues with duplicate MACs when deploying Windows 2008 R2 from template using an E1000 driver.

Note: The preceding link was correct as of January 12, 2011. If you find the link is broken, provide feedback and a VMware employee will update the link.

From :
http://kb.vmware.com/kb/1020078

January 14, 2011

DNS query of multi-label SRV records cause the KMS auto-detection feature not to work

Filed under: MS — raj2796 @ 4:25 pm

From technet (basically you install a hotfix)

When you try to activate Windows 7 or Windows Server 2008 R2, you may receive an error message that resembles the following:
Windows could not be activated. Key management services (KMS) host could not be located in domain name system (DNS), please have your system administrator verify that a KMS is published correctly in DNS. Error: 0x80092328 Description: DNS name does not exist.
Alternatively, you may receive error code 0x800705b4:
This operation returned because the timeout period expired.
This hotfix changes the behavior in which a Domain Name System (DNS) client queries DNS for Key Management Service (KMS). This hotfix applies to DNS clients that are running Windows 7 or Windows Server 2008 R2.
Important The most common causes for this error are described in the following Microsoft Knowledge Base article:
929826 Error message when you try to activate Windows Vista Enterprise, Windows Vista Business, Windows 7, or Windows Server 2008: “Code 0x8007232b”
We recommend that you try the methods that are documented in this article before you install this hotfix.

To query DNS, a DNS client that is running Windows 7 or Windows Server 2008 first queries without appending DNS suffixes. If the first query fails, the DNS client then queries again by appending DNS suffixes.

However, this behavior may cause the KMS auto-detection feature not to work. The KMS auto-detection feature relies on the Service Location (SRV) resource record, that is returned by a DNS query, to specify the location of a KMS host. Because of customer’s DNS configuration, the SRV record may be a multi-label name. In this case, the DNS client cannot locate a multi-label SRV record in the first DNS query. If the first query times out, the DNS client will not run another query by appending suffixes. Instead of a followed suffix query, a failed initial multi-label query is submitted to the upstream DNS host servers that are outside the domain. Therefore, the KMS auto-detection feature does not work and a KMS host cannot be located.

http://support.microsoft.com/kb/981197

October 19, 2010

Windows 2008 Vmware Vsphere additional disk issue

Filed under: MS,vmware — raj2796 @ 1:28 pm

All virtual machine disk files (VMDKs) are presented to VMs as SAN disks and Windows 2008 changed how SAN disks were handled, in effect they are offline until you set them online. You will see the “Disk is Offline because policy was set by an administrator” message.

First you need to change how Windows 2008 sees the SAN devices, then you need to clear a readonly flag, then you are good to go. Using ‘diskpart’ enter the following commands

DISKPART> SAN POLICY=OnlineAll
DISKPART> RESCAN
DISKPART> SELECT DISK 1
DISKPART> ATTRIBUTES DISK CLEAR READONLY
DISKPART> ONLINE DISK
DISKPART> CONVERT MBR

Now you can use your normal mechanisms to add, format, etc. the disk into the system.

http://www.astroarch.com/blog/?tag=policy-set-by-administrator

Blog at WordPress.com.