I'm trying to amend a really useful command from page 82 in the Powershell in a Month of Lunches book. The command imports a list of users from a CSV file and then creates 'labels' matching AD properties so the data can be assigned. The book states that this is useful when your HR department sends you a spreadsheet of users but the supplied column headings (i.e. 'FirstName' or 'LastName') don't correspond with their respective AD properties (i.e 'GivenName' and 'Surname') and therefore the data can't be imported directly.
I can't seem to put a space in between the first name and last name values though. I've tried a few things, including inserting a plus symbol as above, but that doesn't seem to do anything. Therefore, the AD account name comes up as 'JoeBloggs' rather than 'Joe Bloggs'
I'm sure it's something really simple that I'll probably find a bit further on in the book, but I need to do an AD import this week! If anyone has the answer I'll be really grateful!
by mjolinor at 2013-03-10 12:07:18
One way is to use an expandable string, with subexpressions
by NeatAccurateTypist at 2013-03-10 12:20:02
That worked perfectly first time! Thank you so much mjolinor – you're a legend! 🙂