Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script that I downloaded off of Technet.

Problem is that it creates the alias as:

-Alias ($_.FirstName +  ($_.LastName).ToUpper())

where $_.Firstname is the -FirstName field and $_.LastName is the -LastName field.

I'd like to create it as first initial last name instead.


Joe Smith

should become jsmith as the alias

share|improve this question
up vote 2 down vote accepted

I figured it out.

-Alias (($_.FirstName.Substring(0,1)) + ($_.LastName))

Hope that helps someone else.

share|improve this answer
BTW, it is OK to accept your own answer here. – uSlackr Mar 29 '12 at 17:07
@uSlackr - yeah I know...but there is a waiting period. Can't do it until tomorrow. – TheCleaner Mar 29 '12 at 17:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.