Update user accounts with identity


I have a datsource with a mix of logical and pwoline accounnt

I want to leave them as them current account type and add their email to the federated tab so they use can IMS. I only want to action this on our own staff so was thinking i could use eamil as a filter

I had hoped the below would work but I've obviosuly got it wrong somewhere




import-module pwps -verbose

#import-module pwps_dab -Verbose

Open-PWConnection -GUI -Admin 

$users = get-pwuser -EMail "@wsp.com"

foreach ($u in $Users)


$u.Identity = $u.email

Update-pwuser -user $users


Close-PWConnection -Verbose