Author: Noel Alvarez

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 Active Directory – View a List of Servers

You may use the following Windows PowerShell cmdlet to get a list of all of the Windows Servers in your Microsoft Active Directory (AD) domain. In particular, it will provide the hostname of the server, operating system, and service pack then output the results to a CSV file.

Get-ADComputer -Filter ‘OperatingSystem -like “Windows Server*”‘ -Properties Name, OperatingSystem, OperatingSystemServicePack | Sort-Object -Property Name | Format-List -Property Name, OperatingSystem, OperatingSystemServicePack | Out-File -FilePath “<<>>.csv”


Architecture – Questions

Lately, I’ve developed a greater motivation and interest in learning the ins and outs of Information Technology (IT) architecture. Ask any IT professional and he or she will tell you there is so much to learn and that technology is constantly changing. With that said, I’m currently asking and answering the following questions as I learn new technology as well as day to day troubleshooting on the job.

  1. What is it?
  2. What is its purpose and/or function?
  3. What are its components?
  4. How does it work?
  5. What utilities are used to manage it?
  6. Where does it fit within N-Tier architecture?
  7. Draw a diagram.
  8. How does it inform architectural and engineering decisions?

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


Microsoft Windows PowerShell – DHCP Logs

You may use the following Microsoft Windows PowerShell cmdlet to view the last one hundred lines of a Microsoft Windows Server DHCP server log for a particular Internet Protocol (IP) address. This may be useful when you are troubleshooting DHCP errors in Microsoft Windows Server.

Get-Content DhcpSrvLog-Mon.log | Select -Last 100 | Select-String -Pattern “X.X.X.X” -encoding ASCII


Microsoft Windows PowerShell – Resolve-DnsName

You may use the Resolve-DnsName Microsoft Windows PowerShell cmdlet to perform Domain Name System (DNS) query resolution for the domain name(s) you specify. Below you will find a few examples of this cmdlet.

To perform a standard query enter Resolve-DnsName domain.com.

To perform a query without the use of a local hosts file or DNS cache enter Resolve-DnsName domain.com -NoHostsFile.

To perform a query only using the DNS client cache enter Resolve-DnsName domain.com -CacheOnly. NOTE: In this example, the DNS client cache is cleared, first. Therefore, the error is expected.

To perform a query while specifying a particular DNS server enter Resolve-DnsName domain.com -Server X.X.X.X.

To perform a query for a specific DNS record enter Resolve-DnsName domain.com -Type XX.

To perform a query of multiple domains enter domain.com“,”domain.com“,”domain.com” | Resolve-DnsName

To perform a query of domain names using a file enter Get-Content file | Resolve-DnsName. NOTE: I do not recommend placing the file in the C:\Windows\System32 directory. However, I used that directory in this example for simplicity.


Microsoft Windows PowerShell – Remote Server Service Status

The Microsoft Windows PowerShell script below will request the hostname of a server as well as the service to be queried then provide the status of the service.

<#
.SYNOPSIS
This script will request the hostname of a server, the name of the service, then provide it’s status.
.DESCRIPTION
This script will request the hostname of a server, the name of the service, then provide it’s status.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, November 11, 2018.
#>

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

#Request the name of the service
$SERVICE = Read-Host “What is the name of the service?”

#Provide the status of the service
Get-Service -Name $SERVICE -ComputerName $HOSTNAME

#End of script


Microsoft Windows PowerShell – Remote Server Uptime

The Microsoft Windows PowerShell script below will request the hostname of a server then provide it’s uptime using Event ID 6005.

<#
.SYNOPSIS
This script will request the hostname of a server then provide it’s uptime.
.DESCRIPTION
This script will request the hostname of a server then provide it’s uptime.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, November 11, 2018.
#>

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

#Provide the uptime of the server
Get-EventLog -Logname System -ComputerName $HOSTNAME | Where-Object {$_.EventID -EQ 6005} | Select-Object -First 1

#End of script


Microsoft Active Directory – Get Computer Object Last Logon Time

You may use the following Microsoft PowerShell cmdlet to determine the last logon time for a Microsoft Active Directory (AD) computer object.

Get-ADComputer HOSTNAME -Properties LastLogonDate


Brocade – Model Number and Firmware

You may use the following command line interface (CLI) commands on a Brocade fibre channel (FC) switch to view the model number and firmware version of the switch.

switchshow
firmwareshow

In particular the switchType: field of the switchshow command will provide you with the model number of the switch.