Category: PowerShell
-
Configuring Hyper-v Host Network Adapters for ISCSI Storage Connectivity with Powershell .
Windows Server 2012 R2 with PowerShell 4.0 has hugely expanded support for configuring multiple NICs on a Cluster/ISCSI Initiator node via command line. After deploying multiple Network Interface Cards on my Hyper-v host, it took me a while to figure out how to properly configure the NICS with PowerShell . Prior to Windows Server 2012,…
-
PowerShell 3.0 Script creates AD user and Exchange Mailbox.
This interactive script requires PowerShell 3.0 . It creates an Active Directory user and their corresponding mailbox using a remote session at the same time. It should work out of the box, but specific variables will have to be edited to reflect the Active Directory configuration of the organization in question. function New-Employee { Param…
-
PowerShell script utilizes “Using” scope modifier to create VM from existing .vhdx file.
The following interactive PowerShell 3.0 script creates a new virtual machine. It utilizes the ‘Using’ scope modifier to pass local variables to remote machines with the invoke-command cmdlet. An existing .vhdx file is copied to a new location and renamed . Same file is used to create the virtual machine. The script assumes the VM…
-
How to Customize Exchange 2010 RBAC Roles for Delegating User/Contact Management Part 2.
As a follow up to the last post, I decided to further restrict the Support Staff users’ access to the available Custom ‘Address Book Management’ Role cmdlets. The following commands enabled me accomplish this objective: 1) C:\>Get-ManagementRoleEntry -Identity “Address Book Management\*” | ?{$_.Name -ne “Get-User”} | Remove-ManagementRoleEntry ( This command removes all available cmdlets from…
-
How to Restore an Active Directory Object from Backup.
In this post, I am going to talk about my experience doing an Authoritative Restore of a deleted Active Directory user object. The steps were completed by restoring from a previous System State backup and using the ntds utility. I started by deleting a test AD user: Ryan Smith from the Accounting_OU Organizational Unit in…
-
How to remove/delete email sent to wrong user(s) using Search-mailbox cmdlet
I recently came by a situation where confidential email was mistakenly sent to the wrong users. I was asked to find a way to delete the email. I knew I could use the Search-mailbox cmdlet since this is an Exchange 2010 deployment, but totally forgot I had to configure a Role assignment before this could…
-
Configuring Windows Server 2012 as an iSCSI Target SAN in a Two Host Failover Cluster Part 5
As it turns out, I already have two Virtual machines running on one of the cluster nodes. I set these up before the cluster creation. The VMs are currently not cluster roles/resources. I will go ahead and make one of the VMs (WK7) a cluster role by adding it to the cluster. PS C:\> Get-VM…
-
Configuring Windows Server 2012 as an iSCSI Target SAN in a Two Host Failover Cluster Part 4
Here we go over my steps for the actual cluster creation, cluster and node validation, quorum setup and cluster shared volume configuration.We have by running a cluster validation on each node. This can be achieved with the following cmdlets: Test-Cluster -Node hyperv01 Test-Cluster -Node hyperv03 In this case, the test passed. The process basically gives…
-
Configuring Windows Server 2012 as an iSCSI Target SAN in a Two Host Failover Cluster Part 3
In the next part of the series, we will create a simple 1GB iSCSI virtual disk, assign it to the already configured target and verify the disk is visible to the iSCSI initiators. New-IscsiVirtualDisk -Description “Witness Disk” -Path g:\iscsivirtualdisks\Witness00.vhd -Size 1GB -ComputerName labtarget -Verbose (Create the 1GB iSCSI virtual disk) Add-IscsiVirtualDiskTargetMapping -TargetName Target00 -Path g:\iscsivirtualdisks\Witness00.vhd…
-
Configuring Windows Server 2012 as an iSCSI Target SAN in a Two Host Failover Cluster Part 2
In this part of the series, we will configure two hosts as iSCSI initiators. The hosts have already been defined at the Target and ready to log on. Both hosts are running WS 2012 Hyper-v Core and I made sure to install the Failover Clustering and Hyper-v windows features. Following is a snapshot of the cmdlets available…