Tag: windows

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: , , , , , , , , , ,

WintelAdmin.com Completes 5 Years.

 
I am very much exited and proud to announce that WintelAdmin.com has now completed 5 Years. As stated earlier, it all started on 28th June 2010 when I wrote my first post at Winteladmin.com. Bit late but, I am very happy to announce that WintelAdmin.com is celebrating its fifth anniversary with its loyal readers! Sincere thanks to all readers, friends and well-wishers. Special thanks to speedhost.in for their exceptional support on very hard time.
 
affiliate_show_banner.php_180-e1328512765947
 
 Thanks,
WintelAdmin
Filed under: x Updates (Wintel Admin)Tagged with: , , , , , , , ,

Forcibly remove failover cluster feature.

Forcibly remove failover cluster feature.

I was asked to take a clone of Windows 2008 server and release it to appliation team as a replacement server for another standalone Windows 2008 server. Clone was successfully completed and found that the source of the clone is a cluster node. Hence, I had to remove the filover cluster. As this was a virtual server I had the liability of disconnecting it from network and conencted using local admin account. Unfortunately, it was not allowing to uninstall cluster, it required AD authentication. Taking the server back to network and trying to remove the cluster was challenging as this had the possibilities of impacting the existing cluster setup. Sever Manager will not allow you to remove the cluster feature as its still a part of a cluster. Hence, I was then able to find a work around using the registry.

1. Take the complete backup of the registry.
2. Locate HKLM\CurrentControlSet\Services\
3. Delete the keys “ClusDisk” & “ClusSvc”
4. Now try uninstalling the Failover CLustering.
5. You will be prompted with “Have you removed this server from the cluster?”. Yes, I’ve removed this server from the cluster or No. I still need to remove this server from the server.”
6. Click on “Yes, I’ve removed this server from the cluster.”
7. Reboot the server.

You now has the liability of adding the same feature back and setup a new cluster.

Thanks,
WintelAdmin

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

VMware Error 0x0000005D

When you try to install Windows Operating System, you would come across an error code 0x0000005D. This is purely an issue related to the virtual machine profile. Please validate if you have selected a correct profile. if not please choose the correct profile and restart the installation process.

In my case, was trying to deploy Windows 2003 std edition for a legacy application using SCCM 2012. Had no clue with the error code 0x0000005D, though I have set Windows 2003 Std 32 Bit in profile. Later realized that the SCCM is using the latest version and then selected the corresponding 64bit profle like Windows Server 2003 Enterprise x64 Edition – from the drop-down list. Voila it fixed my issue.

VM profile is available at below path.

VM->Edit Settings->Options->General Options->Version

Regards,
WintelAdmin

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

VMware P2V or V2V gives error Unable to contact the specified host.

When you do a P2V or V2V of Windows 2008 server using VMware Converter you might get the below error:

Unable to contact the specified host. The host is not available, there is a network configuration problem, or the management services on the host are not responding.

In order to execute the conversion process, it is necessary to open the required ports on the source. This error would be displayed when the required TCP and UDP ports are not open.

Hence, the best solution is to disable the firewall to fix the issue.

In my case the issue was fixed using the below command.

NetSh Advfirewall set allprofiles state off

Thanks,
WintelAdmin

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

Outbound Emails blocked on Windows Server.

Recently, came across an issue where the outbound SMTP mail where getting blocked. When checked the server and firewall settings everything looked very normal. Finally, the issue was with McAfee. McAfee access protection has a feature to block the out going e-mails. Hence, below listed steps where performed to fix the issue.

1. Click Start, Programs, McAfee, VirusScan Console.
2. Right-click Access Protection and select Properties.
3. Click the Access Protection tab.
4. Under Categories on the left, select Anti-virus Standard Protection.
5. In the right pane, select Prevent mass mailing worms from sending mail.
6. Click on , block tab relevant to “Prevent mass mailing worms from sending mail to remove tick mark.
6. In the Processes to exclude section, type the process name, then click OK to close the Rule details window.
7. Click Apply then close the Access Protection Properties window.

Thanks,
WintelAdmin

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

Fix RDP on Windows 2003 without reboot.

A very common issue on a daily life of a Windows server administrator is that the users complaining about RDP issue. If the issue is with Windows 2008, that’s fine as we can restart the remote desktop services to fix the issue. But the same issue on Windows 2003 is bit annoying.

However, I have found a solution which works perfect.

The fix: (remotely using command prompt)

tasklist /s \\servername /svc /fi “imagename eq svchost.exe” (locate PID for TermService)
taskkill /s \\servername /pid xxxx (may need /f to force, UAC might give problems as well)
sc \\servername start TermService

The Fix: (local, using command prompt)

tasklist /svc /fi “imagename eq svchost.exe” (locate PID for TermService)
taskkill /pid xxxx (may need /f to force, UAC might give problems as well)
sc \\servername start TermService

Detailed Information:

Open a command prompt
Type in: tasklist /svc /fi “imagename eq svchost.exe”
This will list the different instances of svchost.exe and the associated service and PID
Locate TermService and note the PID for it
Open Task Manager and go to the Processes tab. Then click View > Select Columns and check PID, then click OK
Locate the svchost.exe process with the PID noted in step 4, right click it, select End Process
Open services.msc
Start the Terminal Services service

Thanks,
WintelAdmin

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

How to identify the SAN Disk in Windows 2008?

In order to perform a storage testing, one of the server were allocated with two different storage XtremIO and FED.
Both the lun were added to server as a drive. However, we had a confusion to find which drive was from which storage. Luckily, we were able to track the luns using diskpart.

1. Open command prompt.
2. Enter “Diskpart”.
3. Enter “list volume”.
4. Type “Select volume *” (* to be replaced with volume ID Ex:C,D,E/0,1,2, etc)
5. Execute “Detail Disk”

You would now be displayed with disk details and more information, which will help you to track your lun.

Thanks,
WintelAdmin

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

How to restore Backup ROM version on HP servers using ROM Based Setup Utility.

Recently, we upgraded firmware on all our blade enclosures and servers. This time we got stuck with the Citrix servers. We were informed that the Citrix applications are not working after the recent updates. After lot of struggle it was traced out that the issue was due to the ROM version incompatibility and we had to restore the previous ROM version.

This was achieved using the “Redundant ROM Settings” available under RBSU (ROM Based Setup Utility). Please follow the below steps to restore your previous ROM without searching for the setup files.

1. Access ROM Based Setup Utility by pressing the F9 key during power on.
2. Select “Advanced Options”.
3. Select “Advanced System ROM Options”.
4. Choose “ROM Selection”.
5 Select “Switch to Backup ROM”.
6. Press the Enter key.
7. Press the Esc key to exit the current menu or press the F10 key to exit RBSU. The server restarts automatically.

Thanks,

WintelAdmin

 

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

Fixing Remote Desktop (Unnecessary pop-up)

 

Microsoft Remote Desktop is a great tool for connecting to any windows machine on remote. Sometimes, when you are in need of working on many different machines, you get irritated by annoying pop-up like asking username and password before connecting to the server and annoying remote identity pop-up. This needs our manual intervention and sometime delays our task. Hence, found a suitable option to disable these pop-ups. It’s very simple, please follow the below steps:
1. Close all remote desktop connections and exit the remote desktop client.
2. Click Start, click Run, type notepad, and then click OK.
3. On the File menu, click Open.
4. In the Files of type list, click All Files.
5. In the File name box enter Default.rdp (The full path to this file would be similar to the following: C:\Users\<your username>\Documents\Default.rdp)
6. At the bottom of the Default.rdp file, add the following text:
enablecredsspsupport:i:0
authentication level:i:0
7. Save the file and exit notepad.
8. You should no longer be prompted to enter credentials before connecting to remote desktops and confirm that you do indeed intend to connect.

Thanks,
WintelAdmin.com

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