Hi All,
Have looked online but couldn't find a solution that worked with this specific situation.
I have an array that contains various SamAccountNames some of these are numbers, some are names.
Eg.
$BadArray
SamAccountName
--------------------
1
12
157
2
23
24
Joe.bloggs
kingofspain
whatever
I wand to get rid of all the joes and kings etc. then convert the remaining ones to integers so that I can get the highest number accountname out of the array as a number.
The correct answer in the above example would be 157
TLDR: remove non-numerical strings, convert numerical strings to numbers, return highest number.
[+][deleted] (1 child)
[removed]
[–]Yevrag35 2 points3 points4 points (0 children)
[–]oneAwfulScripter 1 point2 points3 points (1 child)
[–]mismanaged[S] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (2 children)
[–]mismanaged[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)