OPS / SCRIPT DETAILS
Script details
Builds a bulk Active Directory group-membership script from a pasted list or CSV. Choose whether users are matched by email address, UPN or account name, preview first, then apply when ready. Review these details before generating or running the script.
active-directorygroupsmembershipusersbulkimport
Generated here. Run by you.Opselith does not connect to your tenant or run PowerShell. After generating, review the script and run it in your own PowerShell session.
What it works with
Module: ActiveDirectory
ActiveDirectory lets PowerShell work with on-premises Active Directory and is normally installed through Windows RSAT.
Context: Windows PowerShell 5.1 · Active Directory RSAT
Compatibility: Run in Windows PowerShell 5.1 on a Windows system with the ActiveDirectory module available.
Permissions and changes
Permissions: Group membership write access
Risk: Medium
Changes data: running this script can modify settings or data. Check the target and test with a controlled scope first.
Changes: Preview mode is read-only. Apply mode adds resolved users to the selected Active Directory group and skips users that are already direct members.
Inputs
- AD group name - Enter the target group, for example Finance-Users. (Required)
- How will you provide the users? - Paste values directly, or let the generated script read them from a CSV. (Required)
- How should users be identified? - Choose the field that matches the values you are providing. (Required)
- Paste users - One email address, UPN or account name per line. These values are not stored in My Toolkit. (Conditional)
- Input CSV path - Absolute Windows path to the CSV that the generated script should read. (Conditional)
- Which CSV column contains the users? - Example: Email, UPN or SamAccountName. (Conditional)
- What should the script do? - Preview resolves the users and shows what would happen without changing the group. (Required)
- Type ADD to confirm - Required only when you choose Add the users. (Conditional)
- Save a result CSV - Optional: save each input value with its resolved user and result. (Optional)
- Result CSV path - Choose a new absolute Windows CSV path. (Conditional)
What to expect
Output: Preview/apply summary with WOULD_ADD, ADDED, already-member and error results. · Optional CSV with each supplied value, resolved identity and result.
Expect a CSV file at the path you choose. Open it in Excel or another CSV viewer and review the rows.
Example: C:\Temp\report.csvThis template is in the Free library and is generated locally in your browser. Opselith does not run it; you review and run the script in your own PowerShell session.
Example use
Builds a bulk Active Directory group-membership script from a pasted list or CSV. Choose whether users are matched by email address, UPN or account name, preview first, then apply when ready.
Enter the required values in the Builder, review the generated script and confirm the output before running it.
Before you run: Start with Preview only. Confirm the target group and how users are identified. Review unresolved or already-member rows, then switch to Add the users only when the preview is correct.
Script checksWhat has been verifiedQA reviewed
Static checksPassed
PSScriptAnalyzerPending
Real-world run testNot yet recorded
Last checkedNot yet recorded
TEST STATUSWhat Opselith has checkedLast reviewed: 3 Sept 2026
PSScriptAnalyzer: Awaiting a release PSScriptAnalyzer gate that includes this script. No analyzer pass is claimed yet.
Pending or Not yet recorded means there is no accepted result on file yet. A passed analyzer check does not mean the script has been run in a real tenant.