Fred Acme
asked on
Creating accounts AD 2k8 PowerShell - Carriage Return in addresses
Hello,
How are you today ?
I've got a problem with Excel, PowerShell and AD (2008 or 2012).
In AD, we have some users with an address on 2 lines (See 2-LINES.JPG attached).
In Excel, I use ALT+ENTER (or "Wrap up automatically" button) to make the return (See 2-LINES-EXCEL.JPG).
Then, I save the file in csv with coma format.
When I lauch my script (this is a part of the script) : New-ADUser -StreetAddress $_.streetaddress
The address is on a signle line.
What should I do to make the address on two lines ?
Thank you for your help !
Fred
2-lines.jpg
2-lines-Excel.jpg
How are you today ?
I've got a problem with Excel, PowerShell and AD (2008 or 2012).
In AD, we have some users with an address on 2 lines (See 2-LINES.JPG attached).
In Excel, I use ALT+ENTER (or "Wrap up automatically" button) to make the return (See 2-LINES-EXCEL.JPG).
Then, I save the file in csv with coma format.
When I lauch my script (this is a part of the script) : New-ADUser -StreetAddress $_.streetaddress
The address is on a signle line.
What should I do to make the address on two lines ?
Thank you for your help !
Fred
2-lines.jpg
2-lines-Excel.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello !
Thank you everybody for your help.
I'll test it rapidly.
Thank you everybody for your help.
I'll test it rapidly.
ASKER
Hello,
Your command is great !
I used it yesterday and all my accounts are OK :)
Thank you !
Your command is great !
I used it yesterday and all my accounts are OK :)
Thank you !
In the csv you can add `r`n between the two lines like below.
"This is the first line`r`nThe Second"
Cheers