WI: Update SPO Language (User) - robedi/PowerShell GitHub Wiki

This work instruction describes how to configure the "Update SPO Language (User)" Custom Command in Adaxes to update the language settings of a user in SharePoint Online (SPO) using PowerShell.

Static Badge Static Badge Static Badge

Prerequisites:

  • Ensure that the Adaxes Service is installed and configured.
  • Azure AD Connector for SharePoint Online should be set up in Adaxes for retrieving the access token.
  • Admin privileges on SharePoint Online are required to configure OneDrive settings.

Steps to Implement:

  1. Open Adaxes Web Interface

    • Log in to the Adaxes Web Interface with an account that has administrative permissions.
  2. Navigate to the Custom Commands Section

    • In the left pane, select Configuration.
    • Under Configuration Objects, click on Custom Commands.
    • Click Create Custom Command to start creating a new command.
  3. Name the Custom Command

    • In the General tab, give the Custom Command a descriptive name such as Update SPO Language (User).
  4. Specify the Object Type

    • Set the Custom Command to run for User objects. This ensures the command is only applicable to user accounts.
  5. Set the Execution Condition (Optional)

    • If you want the script to run under specific conditions (e.g., only for users in a certain group or department), you can specify these conditions in the Execution Condition tab.
  6. Add the PowerShell Script

    • Go to the Script tab, and click Add PowerShell Script.
    • Copy and paste the provided PowerShell script Update_SPO_Language_User.ps1 into the script editor.
  7. Configure the Parameters

    • Ensure the script is correctly linked with your environment by configuring:
      • $SiteURL: The URL of your SharePoint Admin site.
      • $ODUrl: Your organization's OneDrive base URL.
      • Azure AD Connector: Ensure Adaxes is set up to retrieve an access token for SharePoint.
  8. Test the Script

    • Save the Custom Command.
    • Test the script by running it on a few users to ensure the SPO language is updated as expected.
    • Check if the script applies the multilingual settings and updates the user’s OneDrive correctly.
  9. Schedule or Trigger the Custom Command

    • You can schedule this Custom Command to run on specific intervals or trigger it based on specific user actions (like onboarding or profile updates) using Business Rules in Adaxes.
  10. Review Execution Results

    • After running, check the execution logs in Adaxes for any errors or warnings.
    • Verify the language settings in the user’s SharePoint and OneDrive to ensure they are applied correctly.

Additional Notes:

  • Error Handling: Ensure that any errors encountered while executing the script are handled appropriately, and that the user permissions are reverted even if the script fails.
  • Audit: Consider enabling logging for this Custom Command to track when and for which users it was applied.

By following these steps, you can configure and implement the Custom Command in Adaxes to update the SharePoint Online language settings for users programmatically.