Month: March 2016

Microsoft Active Directory – Export Group Membership

You may use the following Microsoft Windows PowerShell script to export the users in a Microsoft Active Directory group to a notepad (.txt) file. Additionally, please edit the out-file -filepath portion of this script to a network location of your choice.

<#
.SYNOPSIS
This script will provide the members of a Microsoft Active Directory group and export them to a notepad (.txt) file.
.DESCRIPTION
This script automates the process of exporting the users in a Microsoft Active Directory group.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, March 17, 2016.
#>

#Import the Microsoft Active Directory module
Import-Module ActiveDirectory

#Request the name of the Microsoft Active Directory group
$GROUP = Read-Host “What is the name of the Microsoft Active Directory group?”

#Export the members of the Microsoft Active Directory group and export them.
Get-ADGroupMember -identity $GROUP | Select Name, SamAccountName | out-file -filepath “C:\Users\User01\Desktop\$GROUP.txt”


Distributed File System – Namespace Server Removal

The following is a step by step guide to removing a Distributed File System (DFS) namespace server for a Microsoft Active Directory (AD) integrated DFS namespace.

  1. Export the DFS namespace configuration with the following command:
    1. dfsutil /root:\\domain.com\namespace /export:namespace.txt /verbose
  2. In the DFS Management console right click and delete HOSTNAME under the Namespace Servers tab for the Microsoft Active Directory intergrated DFS namespace.
    1. \\domain.com\namespace
  3. Remove the file shares on HOSTNAME.
    1. \\hostname\namespace
  4. Verify the folder for the file share in step (3) is empty, then delete it.
    1. C:\DFSRoot\namespace
  5. This completes the process.

Hardware – Hard Disk Drive Wipe

You may use Darik’s Boot And Nuke (DBAN) to delete the data from a physical hard drive using the method below.

1. Press the ENTER key to start DBAN in interactive mode.
2. Entropy: Linux Kernel (urandom)
3. PRNG: Mersenne Twister (mt19937ar-cok)
4. Method: DoD 5220.22-M
5. Verify: Last Pass
6. Rounds: 3



Distributed File System – Remove Orphaned Namespace

The following is a step by step guide on removing an orphaned Distributed File System (DFS) namespace in a Microsoft Active Directory environment.

  1. Open Active Directory Service Interfaces Editor (adsiedit.msc)
  2. Connect to the Default naming context
  3. Navigate to DC=domain,DC=com,CN=System,CN=Dfs-Configuration
  4. Delete the object for the orphaned DFS namespace
  5. Run repadmin /syncall (if you have more than one Microsoft Active Directory domain controller)

VMware vCenter Server 6.0 – Critical Services

You may consider monitoring the following services if you utilize VMware vCenter Server 6.0 in your virtualized infrastructure.

1. VMware VirtualCenter Server (vpxd)
2. VMware Inventory Service (invsvc)
3. VMware vSphere Web Client (vspherewebclientsvc)

Enjoy!


VMware vCenter Server 6.0 – Installation and Configuration

The following is a step by step guide for installation VMware vCenter Server 6.0. This application is used for centralized management of your VMware vSphere infrastructure.

Additionally, this is a lab environment. Therefore, the Platform Services Controller (PSC) will be installed on the same host as VMware vCenter Server and the installation will utilize an embedded vPostgres database.

  1. On the VMware vCenter Installer dialog box select vCenter Server for Windows and click Install.01
  2. On the Welcome to the VMware vCenter Server 6.0.0 Installer dialog box click Next >02
  3. On the End User License Agreement dialog box click the check box to select I accept the terms of the license agreement and click Next >.03
  4. On the Select deployment type dialog box click the check box to select vCenter Server and Embedded Platform Services Controller and click Next >.04
  5. On the Select Network Name dialog box verify the hostname of the VMware vCenter Server is in the System Name: field and click Next >.05
  6. On the VMware vCenter Server dialog box select OK if you do not intend to use IPv6.06
  7. On the vCenter Single Sign-On Configuration dialog box click to check box to select Create a new vCenter Single Sign-On domain and enter the password in the vCenter Single Sign-On password: and Confirm password: fields then click Next >.07
  8. On the vCenter Server Service Account select the check box to Use Windows Local System Account or Specify a user service account and enter an account username and password then click Next >. In this example a Microsoft Active Directory service account is being used. If a service account is being used it will need to be provided the Log on as a service privilege.08
  9. On the Database Settings dialog box click to check box to Use an embedded database (vPostgres) then click Next >.09
  10. On the Configure Ports dialog box accept the default settings and click Next >.10
  11. On the Destination Directory dialog box accept the defaults and click Next >.11
  12. On the Ready to install dialog box review the installation settings and click Install.12
  13. On the Setup Completed dialog box click Finish.13
  14. Verify the vpxd, invsvc and vspherewebclientsvc services are configured with a Startup type: of Automatic and the Service status: is Running.14
  15. Using a web browser, in this example Google Chrome, navigate to the vSphere Web Client (https://HOSTNAME/vsphere-client). On the web interface select Advanced.15
  16. Under Your connection is not private select Proceed to vcenter01.root.sysadmin.net (unsafe).16
  17. On the vSphere Web Client enter the authentication credentials for [email protected] and click Login.17
  18. Upon successfully logging in you will be directed the home page of the VMware vSphere Web Client.18

Microsoft Windows Server 2012 R2 – Dynamic Host Configuration Protocol (DHCP) Export and Import

You may use the following commands to export and import a Dynamic Host Configuration Protocol (DHCP) configuration for a server utilizing Microsoft Windows Server 2012 R2.

netsh dhcp server dump > dhcpconfig.dmp
netsh exec dhcpconfig.dmp

Enjoy!

 


Microsoft Windows Server 2012 R2 – Map a Network Drive

You may use the following command to map a network drive using the Microsoft Command Prompt or Microsoft Windows PowerShell. Additionally, replace the <HOSTNAME> and <SHARE> variables with the appropriate server and share name.

NET — USE Z: \\<HOSTNAME>\<SHARE>

Enjoy!


Microsoft Windows PowerShell – Get Service Status and Start Service

The Microsoft Windows PowerShell script below will provide the status of a service on the specified server, start the service, then provide the status of the service, again.

<#
.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”}