We all know that the OWA page (ECP in purticular) has the option to update the user contact information. However, at time you might in need for a script to enable the similar feature, such as when the OWA feature is not available to all user. I had similar situation in my company, where the OWA feature is not enabled for ALL users, and forced to develop a small PS script which enables the users to update their on contact information self.
Following script gives you a sample, and can extend the fields according to your requirement. Below shows the interface that each user gets, and the username field is choosen authomatically from the user's login page. That makes it clear that the script can only run by the users who directly logged into domain joined computers with their network credentials.
As you are aware, the unsigned script can not be executed from the user machine, unless you change the restriction setting of windows powershell. The following section discuss about how to by pass the powershell execution policy.
You may run the .ps1 script with the switch "Bypass" when running the command.
e.g. PowerShell.exe -NoProfile -nologo -ExecutionPolicy Bypass -File ./script.ps1
Or you may create a batch file (.bat) and call the ps1 script from it, sample batch file entry will look like this,
@ECHO OFF
PowerShell.exe -NoProfile -nologo -ExecutionPolicy Bypass -Command "& '\\server\GAL\UpdatePhone_v2.PS1'"
Save the above line in a .bat file and run it from any computer.
Share you comments.
-Praveen