Tag: windows 2012

How to reduce the size of datastore.edb?

How to reduce the size of datastore.edb?

If your software distribution folder consuming more disk space? Is it good to delete the folder? Hey, before you delete teh folder you have an option to defrag the datastore file to recover free disk space. This will keep you in safe zone.

datastore.edb is located at c:\windows\softwaredistribution\software. In order to shrink its size, please follow the steps listed below:

Stop windows update and Bits service.

Open command prompt and execute the below command:

esentutl.exe /k c:\Windows\SoftwareDistribution\DataStore\DataStore.edb

For help type

esentutl.exe /?

You can also defrag and repair. If problems were detected in the verify do a recovery followed by a repair.

esentutl.exe /r c:\Windows\SoftwareDistribution\DataStore\DataStore.edb
esentutl.exe /p c:\Windows\SoftwareDistribution\DataStore\DataStore.edb

For me, defragging helped to recover around 200 MB free space.

esentutl.exe /d c:\Windows\SoftwareDistribution\DataStore\DataStore.edb

Thanks,
WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , , ,

MMC not starting

MMC is not starting and it shows an error message stating that it will not run with a version of a Internet Explorer earlier than Internet Explorer 5.5.

To work around this issue, create a string entry (REG_SZ) with the name Version and the value “6.0.0.0” under the subkey

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer

Thanks,

WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , , , , , , , ,

Cannot open programs unless “Run As Administrator

One of the application was recently installed on Windows 2012 Server, when I click on the short cut its gives an error message stating ” … has stopped working. Windows can check online for a solution to the problem”. ¬†Further, it gives options to check online for a solution and close the program or close the program.

To my surprise, it was found that the application opens by clicking on “Run as Administrator”. Later, clicking “Run as admin” every time was annoying. Hence, the application was set to run as administrator by default following the steps listed below:

Right click the program and select Properties

Under the compatibility tab, select Run this program as an administrator

Click Apply and OK

Thanks,
WintelAdmin

 

Filed under: Windows(2003/2008/2012)Tagged with: , , , , , , , , , , , , , ,

PowerShell for Administrators – Coming Soon

PowerShell essentials for administrators coming soon on WintelAdmin to help with your daily operations.

Stay Tuned…..

WintelAdmin.com

Filed under: Powershell (Tutorial)Tagged with: , , , , , , , , , , , , , , , , ,

Delete Old Files

Batch script to delete X days old file from specified location. Where is X is number of days.

@echo off
REM Remove files backup older than X days
Echo Deleting Bak file….
forfiles /p “Folder Path” /s /m *.bak /c “cmd /c Del @path” /d -X
Exit

Note:
Folder Path= Replace with target folder.
Replace X with no of days (Eg :3 for 3 days old)

Thanks,
WintelAdmin

Filed under: Scripting (Automation)Tagged with: , , , , , , ,

VMware Tools is no more depended on vSphere/Esxi release.

VMware tools 10.0.0 is now no more dependent on vSphere release/Esxi builds. I think this is the first time when VMware released VMware Tools separately. As per release note its backward compatible, compatible with Esxi 5.0 and also compatible with Workstation 12.0 and VMware Fusion 8.0. It will allow to get the latest new features and enhancements made to the VMware tools faster to the customers.

You can download and install the latest version of VMware Tools from Here.

Thanks,
WintelAdmin

Filed under: VMware (ESX / vSphere), Windows(2003/2008/2012)Tagged with: , , , , , , , , , , , ,

Enable Time Synchronization Between Windows (VM Guest) and ESX (Host).

This is in continuation to my previous post RDP Connection on a virtual server

As discussed earlier there was an issue with the AD authentication and connectivity. It was all because of the different time zone set on an ESX host and the guest operating system. Changing time on DC was not recommended by the AD Team as the impact was unknown and similarly we have no clue on the impact due to time change on ESX cluster. Hence, I decided to manually do the time sync between the ESX host and Guest machine.

Time sync status was validation using the command:
VMwareToolboxCmd.exe timesync status

Enter the command to enable or disable periodic time synchronization.
VMwareToolboxCmd.exe timesync Enable/Disable

We executed below command to fix the issue
VMwareToolboxCmd.exe timesync Enable

Note: VMTools installation directory on Windows is C:\Program Files\VMware\VMware Tools.

Thanks,
WintelAdmin

Filed under: VMware (ESX / vSphere), Windows(2003/2008/2012)Tagged with: , , , , , , , , , ,

RDP Error – The connection cannot be completed because the remote computer that was reached is not the one you specified. This could be caused by an outdated entry in the DNS cache. Try using the IP address of the computer instead of the name.

Unable to connect to the Remote Desktop. Server operating system is Windows Server 2012 Standard R2. When we try to RDP, we get the below error message:

The connection cannot be completed because the remote computer that was reached is not the one you specified. This could be caused by an outdated entry in the DNS cache. Try using the IP address of the computer instead of the name.

There was two server with same configuration and setting but one of connecting to RDP with AD authentication whereas the other was not working. One was physical and the other was virtual hosted on an ESX host.
RDP on physical was good and the issue was with the virtual host. It was confirmed that the issue was due to time latency.
Therefore, this issue was due to the time difference between the virtual machine and the NTP server set on an ESX host.
This issue was later fixed by synchronizing the server time with the ESX host.

Note:
If you do not wish to have auto sync, disable the Windows Time service or block the outbound port 123 on your local firewall.

Thanks,
WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , , , , , ,

Windows 2012 Network Share: The specified network name is no longer available

Shares created on Windows Server 2012 R2 are are inaccessible from Windows XP, Windows Server 2003 or Windows Server 2008.

When you try to access the share you will get an error message stating “The specified network name is no longer available”. Windows 2012 will not accept traffic from an older operating systems.

In rorder to fix the issue, a registry setting on Windows Server 2012 R2 must be modified as listed below:

Back up the Registry Hive/Key and make the following change:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\DependOnService

Original Value: SamSS Srv2

Change to: SamSS Srv

Note: Just delete the 2

After making the change, reboot Windows Server 2012 R2

Note: You may also need to reboot the clients/servers involved

Thanks,
WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , , , , , , , ,

VB Script to collect Windows server hardware details on multiple machines.

VB Script to collect Windows server hardware details. Script will Collect Serial Number, Make, Model, OS, CPU, RAM, Drive details on multiple servers remotely.

Copy below contents and save as filename.vbs and create a machines.txt will all server names one per line.

 

***********************************************************************************************************************

Option Explicit

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Const PATH_TO_INPUT = “Machines.txt”
Const PATH_TO_OUTPUT = “MachineInventory.csv”

Dim fso
Set fso = WScript.CreateObject(“Scripting.FileSystemObject”)

Dim shl
Set shl = WScript.CreateObject(“WScript.Shell”)

Dim input
Set input = fso.OpenTextFile(PATH_TO_INPUT)

Dim output
Set output = fso.CreateTextFile(PATH_TO_OUTPUT, True)

output.WriteLine “Hostname,Serial Number,Make,Model,BIOS Version,Operating System,CPU,Memory (MB),Disk Drives”

Dim wmiService
Dim wmiResults

Dim hostname
Dim make
Dim model
Dim biosversion
Dim operatingSystem
Dim serialNumber
Dim cpu
Dim memory
Dim drives

Dim line
Dim exec
Dim pingResults
While Not input.AtEndOfStream
line = input.ReadLine
hostname = “”
make = “”
model = “”
biosversion = “”
operatingSystem = “”
serialNumber = “”
cpu = “”
memory = “”
drives = “”

Set exec = shl.Exec(“ping -n 2 -w 1000 ” & line)
pingResults = LCase(exec.StdOut.ReadAll)

If InStr(pingResults, “reply from”) Then
WScript.Echo “Reply From: ” & line
On Error Resume Next

Set wmiService = GetObject(“winmgmts:\\” & line & “\root\CIMV2”)

If Not Err.Number = 0 Then
output.WriteLine line & “,Error: ” & Err.Description
WScript.Echo line & “,Error: ” & Err.Description
On Error GoTo 0
Else
On Error GoTo 0
hostname = line

Set wmiResults = wmiService.ExecQuery(“SELECT * FROM Win32_BIOS”, “WQL”, wbemFlagReturnImmediately + wbemFlagForwardOnly)

Dim item
For Each item In wmiResults
serialNumber = Trim(item.SerialNumber)
biosversion = Trim(item.SMBIOSBIOSVersion)
Next

Set wmiResults = wmiService.ExecQuery(“SELECT * FROM Win32_ComputerSystem”, “WQL”, wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each item In wmiResults
make = Trim(item.Manufacturer)
model = Trim(item.Model)
Next

Set wmiResults = wmiService.ExecQuery(“SELECT * FROM Win32_OperatingSystem”, “WQL”, wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each item In wmiResults
operatingSystem = Trim(item.Name)
operatingSystem = Split(operatingSystem, “|”)(0)
memory = Round(Trim(item.TotalVisibleMemorySize) / 1024, 2)
Next

Set wmiResults = wmiService.ExecQuery(“SELECT * FROM Win32_Processor”, “WQL”, wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each item In wmiResults
cpu = Trim(item.Name)
Next

Set wmiResults = wmiService.ExecQuery(“SELECT * FROM Win32_LogicalDisk WHERE DriveType=3”, “WQL”, wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each item In wmiResults
drives = drives & Trim(item.DeviceID) & ” ” & Round(Trim(item.Size) / (1024^2), 2) & “;”
Next

output.WriteLine hostname & “,” & serialNumber & “,” & make & “,” & model & “,” & biosversion & “,” & operatingSystem & “,” & cpu & “,” & memory & “,” & drives
WScript.Echo hostname & “,” & serialNumber & “,” & make & “,” & model & “,” & biosversion & “,” & operatingSystem & “,” & cpu & “,” & memory & “,” & drives
End If
Else
output.WriteLine line & “,No Response”
WScript.Echo line & “,No Response”
End If
Wend

output.Close
input.Close

Set wmiService = Nothing
Set wmiresults = Nothing

***********************************************************************************************************************

 

Thanks,

WintelAdmin

 

Filed under: Scripting (Automation)Tagged with: , , , , , , , , , ,