Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

example:

Joe Smith

should become jsmith as the alias

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.