OK, before I posted, I tried something along the lines of:
@{l=‘pager’;e={‘Unique-header-from-spreadsheet’}}
You’re right - it gave me a valid ‘pager’ value when I imported the CSV, but it didn’t wire up to the AD account ‘Pager’ field.
I didn’t find any -Properties parameter in either of the cmdlets I listed above, but I did find an -OtherAttributes parameter.
I’ve tried variations of:
@{pager = {$_.‘unique-header-from-spreadsheet’}
I experimented moving the quotes around. The closest I got was a direct entry into the ‘Pager’ field, but it was just the phrase ‘$_.unique-header-from-spreadsheet’ and not the relevant value.
 All you need is a “simple” hash table; there’s no need for a script block for the value field.
<pre class=“lang:ps decode:true”>@{pager = $_.’unique-header-from-spreadsheet’}
Actually, the main problem is that the New-ADUser and Set-ADUser commands don’t have a -Pager parameter. So you can’t simply pipe in an object that has a Pager property - there’s nowhere for it to go. You probably will need a different approach. Assuming a CSV file with a Name, samAccountName, and Pager column:
OK, just to follow on from that, I’ve exported a list of users whose ‘Pager’ field is empty. I’ve done a vlookup against a master spreadsheet to get the correct pager numbers for each user and ended up with a 2-column CSV file (Headers are ‘SamAccountName’ and ‘Pager’)
You’re right - ‘Set-ADUser’ doesn’t have a ‘Pager’ parameter, and this time it doesn’t have an ‘-OtherAttributes’ parameter either.
Meh.
Thought I’d play with it before coming here asking for more hand-outs! Read the help for Set-ADUser and found the answer!
OK, just to follow on from that, I've exported a list of users whose 'Pager' field is empty. I've done a vlookup against a master spreadsheet to get the correct pager numbers for each user and ended up with a 2-column CSV file (Headers are 'SamAccountName' and 'Pager')
You’re right – ‘Set-ADUser’ doesn’t have a ‘Pager’ parameter, and this time it doesn’t have an ‘-OtherAttributes’ parameter either.
Meh.
Thought I’d play with it before coming here asking for more hand-outs! Read the help for Set-ADUser and found the answer!