Author: Noel Alvarez

Red Hat Enterprise Linux 7 – Sample Kickstart File

Red Hat Enterprise Linux (RHEL) 7 provides a kickstart file that you may use to automate the installation of RHEL. Below is a sample kickstart file (ks.cfg) that you may modify for the automated installation of RHEL.

 

#version=DEVEL
# System authorization information
auth –enableshadow –passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot –enable
ignoredisk –only-use=sda
# Keyboard layouts
keyboard –vckeymap=us –xlayouts=’us’
# System language
lang en_US.UTF-8

# Network information
network –bootproto=static –device=eth0 –gateway=x.x.x.x –ip=x.x.x.x –nameserver=x.x.x.x,x.x.x.x –netmask=x.x.x.x –ipv6=auto –activate
network –hostname=rhel01

# Root password
rootpw –iscrypted $6$fa
# System services
services –disabled=”chronyd”
# System timezone
timezone America/New_York –isUtc –nontp
user –name=tuser –password=$6$zn

iscrypted –gecos=”Temporary User”
# X Window System configuration information
xconfig –startxonboot
# System bootloader configuration
bootloader –append=” crashkernel=auto” –location=mbr –boot-drive=sda
# Partition clearing information
clearpart –all –initlabel –drives=sda
# Disk partitioning information
part /boot –fstype=”xfs” –ondisk=sda –size=500
part swap –fstype=”swap” –ondisk=sda –size=4096
part pv.614 –fstype=”lvmpv” –ondisk=sda –size=46603
volgroup centos –pesize=4096 pv.614
logvol / –fstype=”xfs” –size=20480 –name=root –vgname=centos
logvol /home –fstype=”xfs” –size=26120 –name=home –vgname=centos

%packages
@^graphical-server-environment
@base
@core
@desktop-debugging
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
kexec-tools

%end

%addon com_redhat_kdump –enable –reserve-mb=’auto’

%end

 


Microsoft Windows PowerShell – Delete DNS A Record

Scripting is a great way to make yourself more efficient as an Information Technology (IT) professional. With that being said, the Microsoft Windows PowerShell script below may be used to automate the deletion of a domain name system (DNS) A record.

<#
.SYNOPSIS
This script will automate the process of deleting a DNS A record.
.DESCRIPTION
This script will automate the process of deleting a DNS A record.
.EXAMPLE
Remove-DnsServerResourceRecord -ZoneName “noelalvarez.net” -RRType “A” -Name “www”.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, December 22, 2016.
#>

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

#Delete the DNS A record
Remove-DnsServerResourceRecord -ZoneName “noelalvarez.net” -RRType “A” -Name “$HOSTNAME” -Force

#End of script


VMware vSphere 6 – Create a Template

VMware includes a great solution, templates, for consistent virtual machine deployments. A template is essentially a master image of a virtual machine that typically includes a guest operating system and applications. Using templates allows you to deploy virtual machines with a consistent configuration. Additionally, below is a step list of steps for creating a template.

  • Install the Microsoft Windows 2012 R2 operating system
  • Install VMware Tools
  • Install Windows Updates
  • Run sysprep (C:\Windows\System32\Sysprep\sysprep.exe)
    • System Cleanup Action: Enter System Out-of-Box Experience (OOBE)
    • Generalize
    • Shutdown Options: Shutdown
  • Right click the virtual machine and select Convert to Template….

 


Windows Server Update Services – Basic Troubleshooting

Windows Server Update Services (WSUS) is a Microsoft solution for applying updates to Windows hosts on a network. While excellent planning an implementation may lead to a successful deployment there may be times when troubleshooting failed updates may be necessary. Below is a list of three basic troubleshooting steps.

  1. Review the WindowsUpdate.log file (C:\Windows\WindowsUpdate.log).
  2. Confirm that your Software Update Point (SUP) is correctly registered in the registry (HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate).
  3. Verify that the client can connect to the WSUS website (http://server.fqdn:port/SimpleAuthWebService/SimpleAuth.asmx).

Microsoft Exchange Server 2010 – Access the Exchange Administration Center (EAC)

After installing Microsoft Exchange Server 2010 you may access the Exchange Administration Center (EAC) using the https://localhost/ecp (from the server that is hosting the application) or https://<servername>/ecp (in this example it is https://exchange01.root.sysadmin.net/ecp).

1. Enter https://exchange01.root.sysadmin.net.ecp in the web browser url address bar. Click Continue to this website (not recommended).

01

2. Enter your authentication credentials then click Sign in.

02

3. Select the appropriate Language: and Time zone: settings then click OK.

03

4. Now you are logged in.

04

 

This completes the process to login to the Exchange Administration Center (EAC).


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 PowerShell – Add a Domain User to a Group

You may use the Microsoft Windows PowerShell script below to remotely add a domain user to the specified group of the server you choose.

<#
.SYNOPSIS
This script will add a domain user to a group on a server.
.DESCRIPTION
This script will automate the process of adding a domain user to a group on a server.
.EXAMPLE
N/A.
.AUTHOR
Modified by Noel Enrique Alvarez on Friday, December 02, 2016.
#>

#Request the domain name
$DOMAIN = Read-Host “What is the domain?”

#Request the username
$– USERNAME = Read-Host “What is the username?”

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

#Request the name of the group
$GROUP = Read-Host “What is the name of the group (i.e. Administrators)?”

([ADSI]”WinNT://$SERVER/$GROUP,group”).psbase.Invoke(“Add”,([ADSI]”WinNT://$DOMAIN/$– USERNAME”).path)


Microsoft Windows PowerShell – nslookup Configuration

You may use the following commands at a Microsoft Windows PowerShell to configure a default domain name system (DNS) server, for that instance, as well specify the type(s) of DNS records to resolve. This may be used for daily support of DNS.

  1. nslookup
  2. server <<<IP ADDRESS>>>
  3. set type=<<<DNS RECORD>>>
  4. domain.com

For example, if you wanted to configure the nslookup session to utilize a Google public DNS server (google-public-dns-a.google.com) and query the domain google.com for all DNS records you would enter the following commands.

  1. nslookup
  2. server 8.8.8.8
  3. set type=all
  4. google.com

Additionally, more information may be found using this link.


Red Hat Enterprise Linux 7 – BIND Installation and Configuration

Domain Name System (DNS) is an integral component of any Information Technology (IT) infrastructure. This is a step by step guide for configuring a Red Hat Enterprise Linux 7 public facing DNS server using the BIND software package. Additionally, I would like to add that, for the purposes of this demonstration the zone file created for noelalvarez.net is not pointing to the genuine Internet Protocol (IP) address of the website.

  1. Enter the command yum update -y to update the server.01
  2. Enter the command yum install bind-chroot bind-utils -y to install bind and DNS utilities.02-0102-0202-03
  3. Enter the command systemctl start named-chroot to start the DNS server.03
  4. Enter the command systemctl status named-chroot to verify the DNS server is running.04
  5. Enter the command rndc status to verify the name server control utility is running (i.e. server is up and running).05
  6. Enter the command journalctl -u named-chroot to verify there are no errors.06-0106-02
  7. Enter the command systemctl enable named-chroot to configure BIND to start automatically after a reboot.07
  8. Enter the command cd /etc to navigate to the etc directory.08
  9. Enter the command cp named.conf named.conf.2016111700 to create a copy of the named.conf file.09
  10. Using a text editor, edit the following fields in the name.conf file.
    1. listen-on port 53 { 127.0.0.1; }; NOTE: Add the Internet Protocl (IP) address of the host.10-01
    2. allow-query     { localhost; }; NOTE: delete localhost; and add any;.10-01
    3. Add a forward lookup zone.10-02
    4. Add a reverse lookup zone.10-02
  11. Enter the command named-checkconf to verify the named.conf file has not syntax errors.11
  12. Enter the command cd /var/named/chroot/var/named/ to navigate to the named directory.12
  13. Using a text editor create the zone file for a forward lookup. In this example it is noelalvarez.net.13
  14. Using a text editor create the zone file for reverse lookup. In this example it is the 67.205.160.0/24 IP address range.14
  15. Enter the command rndc reload to read the changes made to the named.conf and zone files.15
  16. Enter the command cd /etc to navigate to the etc directory.16
  17. Using a text editor, edit the resolv.conf file by adding configuring the server to use it’s IP address for name resolution.17
  18. Enter the command dig noelalvarez.net to query the name server for the A record of noelalvarez.net.18
  19. Additionally, you may use nslookup to query the name server for the various records that were created.19
  20. Lastly, you may query the name server from a host on an external network to verify it is a public facing DNS server.20

Microsoft Windows Server 2012 R2 – Start a Service

You may use the Microsoft Windows PowerShell script below to start a service, remotely.

<#
.SYNOPSIS
This script will a service on the specified server.
.DESCRIPTION
This script automates the process of starting a service.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, March 03, 2016.
#>

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

#Request the status of the service
get-service -computername $SERVER | where-object {$_.name -eq “$SERVICE”}

#Pause for (5) seconds
Start-Sleep 5

#Start the service
get-service -name $SERVICE -computername $SERVER | set-service -status running

#Pause for (5) seconds
Start-Sleep 5

#Request the status of the service
get-service -computername $SERVER | where-object {$_.name -eq “$SERVICE”}

#End of script