Your split operations don't do what you think they do. $result -split '=' splits the string at = into 3 parts:
@{AccountExpirationDate
1/23/2016 6:00:00 PM; userAccountControl
512}
The index access [0] selects the first of these parts (@{AccountExpirationDate), and the .Substring(3) returns the substring from the 4th character (index starts at 0) to the end of the string:
ccountExpirationDate
Same for the other split operation. Index [1] selects the second element from the same array (1/23/2016 6:00:00 PM; userAccountControl), and .Substring(3) returns the substring from the 4th character (index starts at 0) to the end of that string:
3/2016 6:00:00 PM; userAccountControl
Demonstration:
PS C:\> $result = "@{AccountExpirationDate=1/23/2016 6:00:00 PM; userAccountControl=512}"
PS C:\> $result
@{AccountExpirationDate=1/23/2016 6:00:00 PM; userAccountControl=512}
PS C:\> $a = $result -split '='
PS C:\> $a
@{AccountExpirationDate
1/23/2016 6:00:00 PM; userAccountControl
512}
PS C:\> $a[0].Substring(3)
ccountExpirationDate
PS C:\> $a[1].Substring(3)
3/2016 6:00:00 PM; userAccountControl
If $result is acually a string and not a hashtable you should remove the @{ and } from beginning and end of the string:
$result -replace '^@{|}$'
split it at semicolons to separate the key/value pairs from each other, then split each key/value pair at = to separate key from value.
$pair1, $pair2 = $result -replace '^@{|}$' -split '; '
$null, $aed = $pair1 -split '=', 2
$null, $aStatus = $pair2 -split '=', 2
The second argument to the -split operator ensures that everything after the first = goes into the second element, even if it contains another = character. The $null on the left side of the assignment discards the first element of the array returned by the split operation (the key name).
Demonstration:
PS C:\> $result = "@{AccountExpirationDate=1/23/2016 6:00:00 PM; userAccountControl=512}"
PS C:\> $result
@{AccountExpirationDate=1/23/2016 6:00:00 PM; userAccountControl=512}
PS C:\> $pair1, $pair2 = $result -replace '^@{|}$' -split '; '
PS C:\> $null, $aed = $pair1 -split '=', 2
PS C:\> $null, $aStatus = $pair2 -split '=', 2
PS C:\> $aed
1/23/2016 6:00:00 PM
PS C:\> $aStatus
512
$resultis a string and not something else? Because that's what it looks like to me.