-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
SPSFbaSync.ps1 synchronizes user information (email, display name, etc.) from a SQL Membership Provider (Forms Based Authentication) database to the SharePoint User Profile Service, and optionally to the User Information List.
- PowerShell 5.1 or later.
- Administrative privileges on the SharePoint Server.
- SharePoint farm with a User Profile Service Application configured.
- Access to the SQL Membership Provider (FBA) database.
| Parameter | Description |
|---|---|
-ConfigFile |
Mandatory. Path to the .psd1 configuration file. |
-Action |
(Optional) Default runs the sync (default). Install registers the scheduled task (requires -InstallAccount). Uninstall removes the scheduled task. |
-InstallAccount |
(Optional) Credential required when -Action Install is used. The account runs the scheduled task. |
-LogRetentionDays |
(Optional) Number of days of transcript logs to keep in the Logs folder. Defaults to 180. Set to 0 to disable pruning. |
-HistoryRetentionDays |
(Optional) Number of days of archived JSON result snapshots to keep in Results\history. Defaults to 30. Set to 0 to disable pruning. |
Configuration values such as
WebApplicationUrl,SqlConnectionString, andSqlMembershipProviderNameare defined in the.psd1file (see Configuration), not passed as script parameters.
.\SPSFbaSync.ps1 -ConfigFile '.\Config\contoso-PROD.psd1'.\SPSFbaSync.ps1 -ConfigFile '.\Config\contoso-PROD.psd1' -Action Install -InstallAccount (Get-Credential).\SPSFbaSync.ps1 -ConfigFile '.\Config\contoso-PROD.psd1' -Action Uninstall.\SPSFbaSync.ps1 -ConfigFile '.\Config\contoso-PROD.psd1' -WhatIfThe script writes a transcript log per run to the Logs folder and a JSON result file (one row per processed user, with a Status such as Updated, NoChange, MissingProfile, or Error) to the Results folder. From version 2.1.0 it also generates a self-contained HTML report in the Reports folder — see Reports & Audit. Old transcript logs are pruned based on -LogRetentionDays, and archived JSON snapshots based on -HistoryRetentionDays.
- Ensure the provided credentials have access to the SharePoint Farm and the SQL membership database.
- Critical configuration values (
WebApplicationUrl,SqlConnectionString,SqlMembershipProviderName) are validated before the sync runs.
- Test the script in a non-production environment before deploying it widely.
For issues or questions, open an issue or start a discussion.