PowerShell – Read-Host values into an Array

I was recently working on a PS script and I wanted to use read-host values into an array. Here is my solution:

$accounts = (Read-Host "user accounts (separate with comma)").split(',') | ForEach-Object {$_.trim()}
foreach ($account in $accounts)
get-aduser $account | select name

The .split() method is self explanatory, the .trim() method will simply remove leading and trailing spaces and leading and trailing line breaks

Expanding Array on HP ProLiant server

Stage 1 – Physically install the HDDs

Stage 2 – Expand the Array

  1. Start HP Array Configuration Utility:
  1. Select Array that you want to expand and click the Expand Array Button:
Once you press Save the array will start the transformation process.
The speed will depend on amount of data on the existing array and size of the array.
In this example the existing drive has 135GB size with 15GB free:
The expansion rate was approx 9GB per hour
While the process is running you will see these alerts:
You can further increase the speed of the transformation by changing the controller settings (set transformation priority to High):
Changing the priority to High might have an impact on server performance (read/write operations)

Stage 3 – Extend Logical Drive

Select the drive that you want to extend and click the Extend Logical Drive:

accept the default and click save

Read the warning and Click OK
(it basically says that if you are running windows 2000 you might have problems, otherwise you are fine)

That process usually takes just a few seconds/minutes (press refresh button to confirm it’s finished)
To verify open Windows Computer Management/Disk Management:

Stage 4 – Extend OS volume

From command prompt issue commands as listed below:

Verify that all went OK: