Avatar of Fred Acme
Fred Acme
 asked on

Creating accounts AD 2k8 PowerShell - Carriage Return in addresses


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 !

PowershellActive DirectoryMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Fred Acme

8/22/2022 - Mon
Patrick Bogers


In the csv you can add `r`n between the two lines like below.
"This is the first line`r`nThe Second"

Shaun Vermaak

You can also open CSV in Excel and use this formula

Open in new window


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Fred Acme

Hello !

Thank you everybody for your help.

I'll test it rapidly.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
Fred Acme


Your command is great !

I used it yesterday and all my accounts are OK :)

Thank you !