From what I've experienced, you can't directly fetch user profiles w/out the user login. Assuming you're fetching user profiles using the following code, there's two potential approaches I'd take if you only had email addresses.
$site = Get-SPSite https://root
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$userProfile = $profileManager.GetUserProfile("domain\username")
Approaches:
- Use AD PowerShell to get the user account and from there you can get their user login.
You should be able to install AD's PowerShell module if it's not already available. Then run the following to get their account:
$user = Get-ADUser -Filter {EmailAddress -eq "first.last@company.com"} -Properties *
You should then be able to construct their user login:
$userLogin = "domain\" + $user.SamAccountName
- Fetch the user from My Site's "User Information List", then construct their user login.
Code:
$web = Get-SPWeb https://mysite
$user = $web.Lists["User Information List"].Items | where{$_["EMail"] -eq "first.last@company.com"}
You should then be able to construct their user login:
$userLogin = "domain\" + $user["UserName"]
I'm sure there's other potential ways to do this as well, but hopefully one of those proves sufficient.