Powershell code to combine to AD attribute strings

Posted on 2008-11-05
Last Modified: 2012-05-05
In the past I've used the following VBscript code to combine two Active Directory objects into one string.  

      PasswordA = Left(oUser.Lastname,3) & Right=(oUser.adminDisplayName,5)
      PasswordB = Ucase(PasswordA)

I need to write this same code in Powershell and place it in a CSV file.  Recommendations on the most efficient method?
Question by:jloomans
    1 Comment
    LVL 18

    Accepted Solution

    $passwordA = "string1" + "string2"
    $passwordb = $passwordA.ToUpper()

    FYI Powershell Zone:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now