Missing the final Else statement in the conditional statement (cherry picked from commit e391206accaee14742ecc9013c1af3b62074d18c)
@@ -84,6 +84,7 @@ Function UserSearch
return $apppoolobj.applicationPoolSid
}
+ Else
{
#Search by samaccountname
$Searcher = [adsisearcher]""