Merge Cells to one

I have a script that imports a file takes that file and updates the source domain with the targetdomain info, however what im struggling on doing is taking that same file and say merging the domain column with the logonscript column
so currentl the domain column will read domain1 or domain2 and the logonscript column is just login.bat. What i want to do is update the loginscript column with the information from the domain column so that it reads domain1\loginscript.bat
demoUserExport-details.csv
LVL 1
ntr2defAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Uptime Legal SystemsCommented:
Maybe I'm not 100% understanding, but in excel you can make the LogonScript column =A2&"\loginscript.bat" to accomplish this.  Then just drag that formula down to apply to all rows.
demoUserExport-details.xlsx
0
ntr2defAuthor Commented:
but i wanted to be done via powershell script so i can automate it without having to open the file
0
Uptime Legal SystemsCommented:
Can you insert the powershell code for review then?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

ntr2defAuthor Commented:
What i have so far is editing column D which is simple because its a simple replace

$containers = Import-CSV .\userExport_Details.csv
foreach ($container in $containers)
{
    $container.ParentContainer = $container.ParentContainer.replace("domain1.com","targetdomain.com/migration/domain1")
    $container.ParentContainer = $container.ParentContainer.replace("domain2.com","targetdomain.com/migration/domain2")
}
$containers | Export-CSV .\userExport_DetailsUpdated.csv -NoTypeInformation -Encoding ASCII

Open in new window

0
ntr2defAuthor Commented:
I figured it out
$objs =@();
$output = Import-csv -Path.\UserExport_DetailsUpdated.csv | ForEach {
$Object = New-Object PSObject -Property @{            
        NewLogonScript  = [String]::Concat($_.domain,$_.logonscript)
        Domain = $_.Domain
      SamAccountName = $_.SamAccountName
      LogonScript = $_.LogonScript
      ParentContainer = $_.ParentContainer
        OUPath = $_.OUpath
      DN = $_.DN
    }  
    $objs += $Object;
}
$objs
$objs | Export-CSv .\UserExport_DetailsUpdated.csv -notypeinformation
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ntr2defAuthor Commented:
No one provided an answer after numerous tries I figured out the solution on my own
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.