Username creation

Just give input as first name and last name in inputfile

 

Jeevan bobba

Abcdef ghijklmnopqrst

It will create username and by adding v- at the beginning of username and – in between lastname-firstname

 

CLS
$Users= gc C:\Temp\abcd.txt
$Users | %{
$a = $PSItem
if (($a.Substring(0,2) -like “v-“) -and ($a -notmatch ” “) ){“$a”}
else{
$SamAccountName = ((($a -split ” “)[-1..-5] -join “-“).Insert(0,’z-‘))
#$SamAccountName
#If ($samaccountname.length -ge 19){$samaccountname.remove(19)} else {$SamAccountName}
if ($SamAccountName.length -ge 19){$SamAccountName.substring(0, 19)} else {$SamAccountName}
}
}

8 Comments

  1. A person essentially help to make seriously articles I would state. This is the first time I frequented your website page and thus far? I surprised with the research you made to create this particular publish incredible. Excellent job!

  2. hey there and thanks on your info – I’ve definitely picked up anything new from right here. I did on the other hand experience some technical points using this web site, since I experienced to reload the website many instances prior to I could get it to load properly. I had been considering in case your web host is OK? No longer that I am complaining, however sluggish loading circumstances instances will sometimes impact your placement in google and could injury your high quality score if advertising and ***********|advertising|advertising|advertising and *********** with Adwords. Well I am adding this RSS to my e-mail and could look out for a lot extra of your respective interesting content. Ensure that you update this again soon..

  3. I was recommended this web site by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my trouble. You’re incredible! Thanks!

Leave a Reply

Your email address will not be published.