Created
May 15, 2018 16:35
-
-
Save kevinblumenfeld/0fa0437c6ead2839a9d4ac667e02c41b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Name = -join([char[]]$display | select -first 15) | |
$i = 2 | |
Write-Verbose "Display Name: $Display" | |
while (Get-ADUser -filter {samaccountname -eq $name}) { | |
$charsForIteration = ([string]$i).Length | |
$name = -join([char[]]$display | select -first (15 - $charsForIteration)) + $i | |
$i++ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment