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

Print Friendly

Ping multiple server and display IP with status.

This script will ping multiple server available in servers.txt and display IP with status.
Copy below contents and save as filename.vbs and create a servers.txt will all server names one per line.

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

Const ForReading = 1
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objShell = CreateObject(“WScript.Shell”)
If not objFSO.FileExists(“servers.txt”) THEN
wscript.echo “Please create a file named ‘servers.txt’ with one PC name to be pinged per line,”&_
vbcrlf&”with a hard return at the end of each line.”
wscript.quit
end if
tempobj=”temp.txt”

Set objTextFile = objFSO.OpenTextFile(“servers.txt”, ForReading)
logfile=”results.csv”
Set ofile=objFSO.CreateTextFile(logfile,True)
strText = objTextFile.ReadAll
objTextFile.Close
wscript.echo “Ping batch starting, please be patient. This could take some time to”&_
vbcrlf&”finish, depending on the number of hosts to check. You “_
&”will be “&vbcrlf&”notified upon the completion of this script.”
ofile.WriteLine “,”&”Ping Report — Date: ” & Now() & vbCrLf
arrComputers = Split(strText, vbCrLF)
for each item in arrcomputers
objShell.Run “cmd /c ping -n 1 -w 1000 ” & item & ” >temp.txt”, 0, True
Set tempfile = objFSO.OpenTextFile(tempobj,ForReading)
Do Until tempfile.AtEndOfStream
temp=tempfile.readall
striploc = InStr(temp,”[“)
If striploc=0 Then
strip=””
Else
strip=Mid(temp,striploc,16)
strip=Replace(strip,”[“,””)
strip=Replace(strip,”]”,””)
strip=Replace(strip,”w”,” “)
strip=Replace(strip,” “,””)
End If

If InStr(temp, “Reply from”) Then
ofile.writeline item & “,”&strip&”,”&”Online.”
ElseIf InStr(temp, “Request timed out.”) Then
ofile.writeline item &”,”&strip&”,”&”No response (Offline).”
ELSEIf InStr(temp, “try again”) Then
ofile.writeline item & “,”&strip&”,”&”Unknown host (no DNS entry).”

End If
Loop
Next
tempfile.close
objfso.deletefile(tempobj)
ofile.writeline
ofile.writeline “,”&”Ping batch complete “&now()
wscript.echo “Ping batch completed. The results will now be displayed.”
objShell.Run(“””C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\excel.exe “””&logfile)

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

Thanks,
WintelAdmin

Print Friendly

Server (HP) not reachable on network “Port was disabled because a pause flood was detected” .

Host was not reachable on network. When checked on ILO server is up and running. When I try to ping the server its unresponsive.Host is a blade server, hence suspected an issue with the network module. Therefore, connected virtual connect. Found one of the virtual connect module was degraded. When analysed the HP Virtual connect found an error message stating “Port was disabled because a pause flood was detected”

Further to this when validated the server port assigned to the bay1/bay2 found the status “Not Linked/Pause Flood Detected”. It confirms the issue was caused by pause Flood. In some cases, a flex-10 port can enter into disabled state due to the triggering of “pause-flood”, or network-loop. You can confirm the same port status using Virtual Connect Manager CLI. Connect to Virtual connect using SSH and Execute the below command:

Show port-protect

This would show the blade server that’s in impact. To fix the issue, please execute the below command:

reset port-protect

Verify the port status again using the command “show port-protect” and ensure no port’s protect types are reported as “Pause Flood”.
Another action plan would be to update the Drivers and Firmwares.

You can also disable is using the command listed below
set port-protect pauseFlood=Disabled

Thanks,
WintelAdmin

Print Friendly

VMware Virtual Machine Reporting from VSphere

VMware PowerCLI is a powerful utility to generate virtual machine information and status. This is very cool and handy tool. I use to generate VMTools status, Datacenter and ESX host name information.

Command to connect vCenter:

Connect-VIServer vcenter1, vcenter2, vcenter

Initialize VMTools Version:
New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine -ValueFromExtensionProperty ‘Config.tools.ToolsVersion’ -Force

Initialize VMTools Status:
New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine -ValueFromExtensionProperty ‘Guest.ToolsVersionStatus’ -Force

Verify VMTools status on all virtual machines and export the output to excel:
Get-VM | Select Name, ToolsVersion, ToolsVersionStatus | Export-Csv -NoTypeInformation -UseCulture -Path C:\Temp\VMToolsInfo.csv

Export VM name, cluster and ESX Host:
Get-VM | Select Name, @{N=”Cluster”;E={Get-Cluster -VM $_}}, @{N=”ESX Host”;E={Get-VMHost -VM $_}} | Export-Csv -NoTypeInformation C:\temp\VM_CLuster_Host-.csv

Export VM name and Cluster name:
Get-VM | Select Name, @{N=”Cluster”;E={Get-Cluster -VM $_}} | Export-Csv -NoTypeInformation C:\temp\test-VM_CLuster.csv

Thanks,
WintelAdmin.

Print Friendly

Error: Could not access VBscript run time for custom action.

Recently got an update from the application team that they are unable to install and software. When executing the setup file they are getting an error pop-up window stating “Could not access VBscript run time for custom action.”. This issue was fixed using below steps:

1. Open Registry Editor” and locate the below key.

HKEY_Local_Machine\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}

2. Expand {B54F3741-5B07-11CF-A4B0-00AA004A55E8} key, locate InprocServer32 and click on it.
In the right column you should see two values.

3. Right-click InprocServer32 > Permissions > Advanced > Permissions > highlight Administrators, choose Edit > and in the Permissions check box next to Full Control; Save all changes;

4. Then in the right column or Registry Editor right-click (Default) > Modify, and insert the correct path in Value Data:

C:/Windows/system32/vbscript.dll

5. If you have 64-bit Windows repeat steps 3 – 5 for next registry keys:

HKEY_Local_Machine\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}

HKEY_Local_Machine\SOFTWARE\Wow6432Node\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8

6. After that close Registry Editor.

After the above changes when we tried executing the same setup it went success.

Thanks,
WintelAdmin

Print Friendly

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

Print Friendly

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

Print Friendly

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

Print Friendly

Windows could not finish configuring the system.

Recently, I was installing Windows 2008 R2 on a HP ProLiant DL380 Gen9 server. Found that the server was throwing an error message stating “Windows could not finish configuring the system.”. When you click on “OK”, servers gets automatic reboot and shows again the same error.

When searched on google, I found that this error message occurs with Windows Server 2008 R2 operating systems if the system contains a registry key that is larger than 8 kilobytes (KB). A Hotfix for this problem is available from Microsoft

KB981542

In my case it was during a clean install of Windows OS, hence it was fixed following the steps listed below:

When you find the error message stating that the “Windows could not finish configuring the system” appears on your screen:

1. Hold down the SHIFT key and press F10 (SHIFT + F10) to open command prompt.
2. At command prompt type: cd oobe (& press Enter).
3. Then type: msoobe (& press Enter).
4. Finally Restart your computer.

You will see your machine back with CTRL+ALT+DEL screen.

Thanks,
WintelAdmin

Print Friendly

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

Print Friendly


Visitors Count

Subscriber Count

    3214
August 2016
M T W T F S S
« Dec    
1234567
891011121314
15161718192021
22232425262728
293031