PowerShell for Administrators – Coming Soon

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

Stay Tuned…..

WintelAdmin.com

Print Friendly

Verify WMI for MS Cluster issues

In a cluster environment, WMI is often used to share information and notification within the nodes. Some of the cluster issues/error due to the WMI is as listed below:

“RPC Server Unavailable” error.
Access is Denied.
The computer ‘Node1’ could not be reached.
Failed to retrieve the maximum number of nodes for ‘{0}’.
The computer does not have the Failover Clustering feature installed. Use Server Manager to install the feature on this computer.
Note: first confirm you have installed the Failover Clustering feature on this node

In above case we need to make sure that the WMI is working fine and this can be confirmed following the steps listed below:
Make sure that the WMI service is up and firewall settings.

1. Launch CMD
2. Type “WBEMTest” (without quotes”).
3. The Windows Management Instrumentation Tester will launch
4. Select Connect
5. Namespace: Root\MSCluster
6. Select Connect and if you see more options available, it means you are connected and WMI is working
7. Click on Query and enter SELECT * from MSCluster_Resource to confirm (any error shown represents WMI issue).

Thanks,
WinteAdmin

Print Friendly

IBM DB2 error SQL5005C during server startup.

Upon windows server hosting DB2 reboot you will get an error message “SQL5005C”. This actually refers to “The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file.” This is due to DB2 database utility (such as db2start, db2icrt, restore, or many others) requires that the database manager write to or read from either the database manager configuration file or the database configuration file, and the database manager was unable to access the configuration file.

This is fixed by performing the below steps:

1. Log in to the machine as system administrator.
2. Remove the db2systray by performing the following steps:
a. Windows Start –> All Programs –> IBM DB2 –> Command Line Tools –> Command Window Administrator.
b. db2systray -clean
3. Log off and log in to the machine.

Thanks,
WintelAdmin

Print Friendly

HP ILO Power and Reset CLI commands

You can also SSH into the ILO and examine the command-line options. After Connecting to ILO using Putty. “power help” will list the options available.

power on – Turn the server on
power off – Turn the server off
power reset – Reset the server

If the ILO is not connecting you may need to reset the ILO. In order to reset the ILO, you should have Lights-Out Online Configuration Utility installed on server. You can reset the ILO using the command listed below

hponcfg /reset or hponcfg /

If you have GUI installed,

1. Open
2. click on “Summary”
3. Select “Reset ILO/Set to factory default”
4. Click on “Reset” available under “Reset ILO firmware”.

On successful reset you will get a pop-up “Successful execution”.

Thanks,
WintelAdmin

Print Friendly

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


Visitors Count

Subscriber Count

    3481
December 2016
M T W T F S S
« Nov    
 1234
567891011
12131415161718
19202122232425
262728293031