Category: Hardware

Microsoft Windows PowerShell – Get Host Architecture

You may use the following Microsoft Windows PowerShell script below to get the architecture, physical or virtual, of a Windows host on a network.

<#
.SYNOPSIS
This script will provide the architure (physical of virtual) of a host.
.DESCRIPTION
This script will provide the architure (physical of virtual) of a host.
.EXAMPLE
systeminfo /s $HOSTNAME | findstr /c:”Model:” /c:”Host Name”
.AUTHOR
Written by Noel Enrique Alvarez on Tuesday, April 23, 2019.
#>

#Requst the hostname of the host
$HOSTNAME = Read-Host “What is the hostname of the server?”

#Provide the architure of the host
systeminfo /s $HOSTNAME | findstr /c:”Model:” /c:”Host Name”


Hardware – View Architecture of Host

You may use the following command from the command prompt or Windows PowerShell to view the architecture, physical or virtual, of the local or remote host on a network. In the second command substitute the %computername% variable with the hostname of the host to be queried.

systeminfo | findstr /c:”Model:” /c:”Host Name”
systeminfo /s %computername% | findstr /c:”Model:” /c:”Host Name”


Microsoft Windows Server 2008 R2 – Disk Cleanup Installation

By default, the Disk Cleanup utility is not present on Microsoft Windows Server 2008 R2. However, copying the files below to the appropriate directories will make the utility available for use. After the files have been copied enter the command Cleanmgr.exe into a command prompt or Microsoft Windows PowerShell session to start the utility. Lastly, further documentation may be found here.

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe > %systemroot%\System32

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui > %systemroot%\System32\en-US


Dell – Get Service Tag Remotely

You may use the Microsoft Windows PowerShell script below to get the service tag of a Dell server, remotely.

<#
.SYNOPSIS
This script will automate the process of determining the service tag of a Dell server.
.DESCRIPTION
This script will query the server you specificy for it’s service tag.
.EXAMPLE
wmic /user:administrator /node:hostname bios get serialnumber.
.AUTHOR
Written by Noel Enrique Alvarez on Monday, December 05, 2016.
#>

#Request the domain name
$– USERNAME = Read-Host “What is the username of the administrator account?”

#Request the hostname of the server
$HOSTNAME = Read-Host “What is hostname of the server?”

#Get the service tag
wmic /user:$– USERNAME /node:$HOSTNAME bios get serialnumber

#End of script


Microsoft Windows Server 2012 R2 – Verify Network Interface Card Status

You may use the Microsoft Windows PowerShell script below to verify the network interface card (NIC) status on servers running the Microsoft Windows Server 2012 R2 operating system. Additionally, the output of the script will be displayed in a graphical user interface (GUI).

<#
.SYNOPSIS
This script will verify the network interface card status of the selected servers.
.DESCRIPTION
This script will automate the process of verifying the network interface card status of the selected servers.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, August 05, 2016.
#>

#Verify the network adapter status of the branch servers
Get-NetAdapter -CimSession (Get-Content “C:\Scripts\Branch Servers.txt”) -Name NIC1, NIC2 | select SystemName, Status, MediaConnectionState | Out-GridView -Title “Network Adapters”

#End of script

 


Microsoft Windows Server 2012 R2 – Configure Hard Disks

The Microsoft Windows PowerShell script below may be used to automate the process of configuring hard disks in Microsoft Windows Server 2012 R2.

<#
.SYNOPSIS
This script will configure hard disks.
.DESCRIPTION
This script will automate the process of configuring hard disks.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, October 13, 2016.
#>

#Request the disk number
$Disk_Number = Read-Host “What is the disk number?”

#Request the disk letter
$Disk_Letter = Read-Host “What is the drive letter?”

#Request the disk size
$Disk_Size = Read-Host “What is the drive size?”
$Disk_Size = $Disk_Size -as [int]
$Disk_Size = $Disk_Size * “1GB”

#Initialize the disk
Initialize-Disk -Number $Disk_Number

#Pause for (5) seconds
Start-Sleep 5

#Configure the disk
New-Partition -DiskNumber $Disk_Number -DriveLetter $Disk_Letter -Size $Disk_Size
Format-Volume -DriveLetter $Disk_Letter -FileSystem NTFS -Confirm:$False
&”.\configure_disk_settings.ps1″

#End of script

 


Scripting – List Remote Hard Disk Space

You may use the script below to query a list of remote servers for their drive letters, drive sizes, and the amount of free space on each drive in gigabytes (GB).

<#
.SYNOPSIS
This script will provide the drive letter, drive size and free space of a list of servers.
.DESCRIPTION
This script will automate the process of providing the drive letter, drive size and free space of a list of servers.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Wednesday, March 23, 2016.
#>

#Provide the hard drive information for the servers in the Remote_Servers.txt file
$Computers = Get-Content “<<<INSERT PATH>>>\Remote_Servers.txt”
gwmi Win32_LogicalDisk -Computer $Computers -Filter ‘DriveType = 3′ `
| select SystemName, DeviceID,
@{n=’Size’;e={[int]($_.Size/1GB)}},
@{n=’FreeSpace’;e={[int]($_.FreeSpace/1GB)}}


Scripting – List Local Hard Disk Space

You may use the script below to query the drive letters, drive sizes, and the amount of free space on each drive in gigabytes (GB) for the local host.

<#
.SYNOPSIS
This script will provide the drive letter, drive size and free space of the local server.
.DESCRIPTION
This script will automate the process of providing the drive letter, drive size and free space of the local server.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Wednesday, March 23, 2016.
#>

#Provide the hard drive information for the local server
Get-WmiObject Win32_LogicalDisk -Filter ‘DriveType = 3′ `
| select SystemName, DeviceID,
@{n=’Size’;e={[int]($_.Size/1GB)}},
@{n=’FreeSpace’;e={[int]($_.FreeSpace/1GB)}}


Dell Compellent – Verify Front and Back End Ports

You may use the Dell Enterprise Manager Data Collector Manager to configure the SMTP settings of a Dell Compellent Storage Area Network (SAN) and provide you with alerts. In addition to this you may manually verify that the front and back end ports of the storage array are Up. To do so navigate to Dell Storage > Storage CentersStorage Center > Fault Domains. As you can see from the output below all of the ports are Up.

01

02


Cisco Unified Computing System – Diagnostics for the Unified Computing System (UCS)

The following is a step by step guide running the Cisco Unified Computing System blade diagnostic utility.

  1. Mount the ucs-blade-server-diags.1.0.1b.iso which may be found here.
  2. On the Unified Computing System Blade Server Diagnostics homepage select Offline Diagnostics (GUI).02
  3. On the UCS Blade Diagnostics v1.0(1b) page select < Accept  >.03
  4. On the UCS Blade Diagnostics UCS B200 M3 page select Diagnostic Tools > Tests > Comprehensive Tests > Run all comprehensive tests.04
  5. After the completion of the Comprehensive Tests the output will be provided.05-0105-02