Category: Microsoft Windows Server 2012 R2

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


Microsoft Exchange Server 2016 – Prerequisites

The implementation of Microsoft Exchange Server 2016, like any other critical component of an Information Technology (IT) infrastructure, has prerequisites. These includes prerequisites for Microsoft Active Directory (AD) as well as the operating system.

Microsoft has provided a list of the prerequisites for Microsoft Exchange Server 2016. That documentation may be found here.


Microsoft Exchange Server 2016 – Mailbox Server Role Interactive Installation

Microsoft Exchange Server 2016 may be installed using the graphical user interface (GUI) or Windows PowerShell. Below you will find a step-by-step tutorial outlining the GUI installation of Microsoft Exchange Server 2016.

  1. Right click the setup.exe file and select Run as administrator.
  2. On the Check for Updates? dialog box select Connect to the Internet and check for updates then click next.
  3. On the Downloading Updates… dialog box click next.
  4. On the Introduction dialog box click next.
  5. On the License Agreement dialog box select I accept the terms in the license agreement then click next.
  6. On the Recommended Settings dialog box select Use recommended settings then click next.
  7. On the Sever Role Selection dialog box select Mailbox role then click next.
  8. On the Installation Space and Location dialog box specify the installation path of your choice.
  9. On the Exchange Organization dialog box specify the name of the Exchange Organization then click next.
  10. On the Malware Protection Settings dialog box, under the Disable malware scanning. option select No then click next.
  11. On the Readiness Checks dialog box click install.
  12. On the Setup Completed dialog box click finish.
  13. Reboot the server.

Microsoft Exchange Server 2016 – Mailbox Server Role Prerequisites

The Microsoft Exchange Server 2016 Mailbox Server role prerequisites may be installed during the graphical user interface (GUI) installation of the Mailbox Server role. Additionally, and recommended, you may use the process below to install the required prerequisites on the server that will be hosting the Mailbox Server role. These include installing operating system features, preparing Microsoft Active Directory (AD), installation Microsoft .NET Framework 4.5.2, and installing Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit.

  1. Right click Windows PowerShell and select Run as Administrator.
  2. Use the following cmdlet to install the required features, then reboot the server.
    1. Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation
  3. Use the Install-WindowsFeature RSAT-ADDS cmdlet to prepare Microsoft Active Directory.
  4. Right click the Microsoft .NET Framework 4.5.2 executable file and select Run as administrator.
  5. On the .NET Framework 4.5.2 Setup dialog box select the check box that states I have read and accept the license terms., then click Install.
  6. On the Do you want Setup to close your programs? dialog  box click Yes.
  7. On the Installation is Complete dialog box click Finish.
  8. Right click the Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit executable file and select Run as administrator.
  9. On the Microsoft Unified Communications Managed API 4.0, Runtime Setup dialog box click Next >.
  10. On the Microsoft Unified Communications Managed API 4.0, Runtime Setup dialog box select the check box that states I have read and accept the license terms., then click Install.
  11. On the Installation is Complete dialog box click Finish.

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….

 


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


Microsoft Windows Server 2012 R2 – Verify Service Status

You may use the Microsoft Windows PowerShell script below to verify the status of the service you specify, remotely.

<#
.SYNOPSIS
This script will provide the status of a service on the specified computer.
.DESCRIPTION
This script automates the process for verifying the status of a service.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Tuesday, November 24, 2015.
#>

#Request the hostname of the server
$SERVER = 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?”

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

#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