You may modify the script below to automate the process of configuring an iSCSI Initiator with the Windows Server 2012 R2 operating system.
Microsoft Windows PowerShell – Configuring iSCSI Initiator Connections with Windows Server 2012 R2
February 5, 2014
Noel Alvarez