PSPowerScripts Request a quote Start a 14-day trial

The catalog · release 2026.219

All 240 ready-to-run PowerShell scripts

Every script below ships with PowerScripts for Microsoft 365, Active Directory, your network and business systems. Each one opens as a form: you grant it to the people who should run it, and every run is recorded. Use a script as it is, or make your own copy and change it; catalog updates never overwrite your edits.

240 scripts

Microsoft 365 · 157

Exchange Online 49

Add-CalendarPermissionreversibleGive one or more users access to one or more mailbox calendars, optionally as a calendar delegate.
  • MailboxUPNs required One or more mailboxes whose calendar is being shared.
  • UserUPNs required One or more users receiving calendar access.
  • AccessRights Owner, PublishingEditor, Editor, PublishingAuthor, Author, NonEditingAuthor, Reviewer, Contributor, LimitedDetails, or AvailabilityOnly. Default: Reviewer.
  • AsDelegate Also flag the user as a calendar delegate so they receive meeting requests. Requires an Author-or-higher access right.

Connects to: exchange-online

Undo: @{script=Remove-CalendarPermission; parameter_map=; confirm=Remove calendar access to {MailboxUPNs} for {UserUPNs}?}

Add-DistributionGroupMemberreversibleAdds one or more recipients to one or more Exchange distribution or mail-enabled security groups — the groups Graph cannot write. Idempotent — skips existing memberships, and skips Microsoft 365, dynamic, and directory-synced groups with the reason.
  • GroupIds required One or more distribution or mail-enabled security groups — display name, alias, SMTP address, or GUID. Right-click a group in M365 search to add it to the list.
  • UserUPNs required One or more recipients to add. Any mail-enabled recipient works — users, shared mailboxes, mail contacts, or nested groups. Right-click users in M365 search to stack them.
  • BypassManagerCheck When true, adds to groups the running account does not manage. Requires the Security Group Creation and Membership role; leave false unless an add fails the manager check.

Connects to: exchange-online

Undo: @{script=Remove-DistributionGroupMember; parameter_map=; confirm=Remove {UserUPNs} from {GroupIds}?}

Add-MailboxAliasreversibleAdd one or more secondary SMTP aliases to one or more cloud mailboxes, leaving the primary address unchanged.
  • MailboxUPNs required One or more mailboxes to add the aliases to.
  • Aliases required One or more alias addresses to add, e.g. sales@contoso.com.
  • SkipDomainCheck Add the aliases without validating their domains against the tenant's accepted domains.

Connects to: exchange-online

Undo: @{script=Remove-MailboxAlias; parameter_map=; confirm=Remove alias {Aliases} from {MailboxUPNs}?}

Add-ResourceDelegatereversibleAdd one or more people as booking delegates on one or more room or equipment mailboxes.
  • ResourceUPNs required One or more room or equipment mailboxes.
  • DelegateUPNs required One or more users to add as booking delegates.
  • ForwardRequestsToDelegates Forward booking requests to the delegates for approval. Default: true.
  • AllowNonResourceMailbox Allow targets that are not room or equipment mailboxes.

Connects to: exchange-online

Undo: @{script=Remove-ResourceDelegate; parameter_map=; confirm=Remove {DelegateUPNs} as delegate(s) on {ResourceUPNs}?}

Audit-NonOwnerMailboxAccessFind non-owner access events on a mailbox over the last N days, via the Unified Audit Log.
  • MailboxUPN required Mailbox to audit. Example: ceo@contoso.com
  • DaysBack How many days of history to scan. Default 30. Max 90 (UAL retention).
  • ResultSize Cap on rows returned from the UAL search. Default 5000.

Connects to: exchange-online

Audit-ResourceMailboxComplianceSearches the Unified Audit Log for non-owner access on resource (room/equipment) mailboxes. (Search-MailboxAuditLog was retired April 2024.)
  • ResourceFilter required 'All' or a specific identity.
  • DaysBack Lookback window in days. Default 90.
  • ExportReport Emit a final 'report generated' marker.

Connects to: exchange-online

Convert-MailboxTypeConverts a mailbox to Room, Equipment, or Shared type.
  • MailboxIdentity required Target mailbox identity.
  • ConversionType required ToRoom, ToEquipment, or ToShared.

Connects to: exchange-online

Export-EmailTrafficReportExports an email traffic, spam, malware, or phish report. Traffic uses the Microsoft Graph getEmailActivityUserDetail report; spam/malware/phish use Get-MailDetailATPReport / Get-MailDetailMalwareReport.
  • StartDate required Inclusive start date.
  • EndDate required Inclusive end date.
  • ReportType Traffic, Spam, Malware, or Phish. Default Traffic.

Connects to: exchange-online, graph

Get-DelegateAccessAuditAudits non-owner delegate access events across one or all mailboxes via the Unified Audit Log. (Search-MailboxAuditLog was retired April 2024.)
  • MailboxFilter required Mailbox UPN to audit, or 'All' for all mailboxes.
  • DaysBack Audit lookback window in days. Default: 30.

Connects to: exchange-online

Get-ExternalMessageTrackingTraces mail exchanged with outside domains over the last 1-90 days (Get-MessageTraceV2, paged in 10-day slices), classes each message inbound or outbound against the accepted domains, and lists the busiest external domains. Read-only.
  • DaysBack Days to look back, 1-90. Default: 7.
  • Direction Inbound, Outbound or All. Default: All.
  • SenderAddress Only trace mail sent by these addresses.
  • RecipientAddress Only trace mail sent to these addresses.
  • MaxResults Stop after this many trace rows. Default: 50000.
  • OutputFormat Table, CSV or JSON. Default: Table.

Connects to: exchange-online

Get-ForwardingAuditReportFinds mail forwarded out of the organisation (targets resolved with Get-Recipient, so mail contacts pointing outside count as external) and inbox rules that look like a compromised mailbox (external forwarding, blank names, moving mail to RSS or Archive, mark-as-read, delete). Rates each finding HIGH/MEDIUM/LOW and reports whether automatic external forwarding is blocked. Read-only.
  • MailboxFilter Mailbox to audit, or All for every user and shared mailbox. Default: All.
  • IncludeInternal Also list rules that forward only inside the organisation.

Connects to: exchange-online

Get-MailboxAccessReportReports who currently has access to one or more mailboxes — FullAccess, SendAs, SendOnBehalf, calendar permissions, and forwarding — optionally expanding group trustees to their members.
  • MailboxUPNs required One or more mailboxes to audit.
  • IncludeCalendar Include calendar folder permissions. Default: true.
  • ExpandGroups Resolve group trustees to their members so group-held access is visible.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: MailboxAccessReport.csv.

Connects to: exchange-online

Get-MailboxDeletionAuditAudits soft-delete, hard-delete, and purge operations on a mailbox via the Unified Audit Log. (Search-MailboxAuditLog was retired April 2024.)
  • MailboxUPN required UPN of the mailbox to audit.
  • DaysBack Lookback window in days. Default: 90.

Connects to: exchange-online

Get-MailboxSizeReportGenerates a Summary, Detailed, or Quota report of mailbox sizes and usage and exports to CSV/JSON/Grid.
  • MailboxFilter required Mailbox filter (UPN, alias, or 'All').
  • ReportType Report type: Summary, Detailed, or Quota. Default Summary.
  • OutputFormat Export format: CSV, JSON, or Grid. Default CSV.
  • IncludeArchive Include archive mailbox stats.
  • DryRun Preview action without executing.

Connects to: exchange-online

Get-MailboxWeeklyStatsWeekly numbers for a shared or support mailbox: mail received, replies sent, senders, average first-reply time and conversations not answered within a day, plus the busiest day and hour. Keeps a trend chart in PowerScripts; schedule it weekly. Read-only.
  • Mailbox required Mailbox to report on (shared, support or user mailbox).
  • Weeks How many full weeks to report. Default: 8.
  • ReplyWithinHours A conversation counts as not answered when the first reply took longer than this. Default: 24.

Connects to: graph

Get-MessageTraceReportTraces a message by Message-ID or sender address over the last 1-90 days (Get-MessageTraceV2) and shows each recipient's delivery path - receive, rules, spam verdicts, delivery or failure (Get-MessageTraceDetailV2). Read-only.
  • MessageIdentifier required Message-ID header value (angle brackets optional), or the sender's address.
  • IdentifierType Auto, MessageId or Sender. Auto treats a plain address as a sender. Default: Auto.
  • DaysBack Days to look back, 1-90. Default: 10.
  • MaxDetails Most recipients to fetch delivery detail for (one query each). Default: 50.
  • OutputFormat Table or CSV. Default: Table.

Connects to: exchange-online

Get-PermissionChangeTrackingQueries the unified audit log for mailbox permission add/remove/update events over a rolling window.
  • DaysBack Lookback window in days. Default: 7.
  • OutputFormat CSV or Grid. Default: CSV.

Connects to: purview

Get-ResourceMailboxReportReports utilization, booking policy, or full inventory across resource mailboxes.
  • ReportType Utilization, Bookings, or AllResources. Default Utilization.
  • OutputFormat CSV or Grid. Default CSV.

Connects to: exchange-online

Get-SafeLinksTrackingQueries the unified audit log for Safe Links clicks and Safe Attachments events over a rolling window.
  • DaysBack Lookback window in days. Default: 30.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: purview

Get-TransportRuleHitReportLists which mail flow (transport) rules fired on which messages over the last 1-10 days (Get-MailDetailTransportRuleReport, TransportRuleHits), with hits per rule and the enabled rules that never fired. Read-only.
  • DaysBack Days to look back, 1-10 (the service keeps rule-hit detail for 10 days). Default: 7.
  • RuleNameFilter Only these rules; partial names allowed. Empty = every rule.
  • MaxResults Stop after this many hits. Default: 50000.
  • OutputFormat Table or CSV. Default: Table.

Connects to: exchange-online

Get-VipMailboxActivityAudits all access events for VIP mailboxes (UPN or CSV) via the Unified Audit Log. (Search-MailboxAuditLog was retired April 2024.)
  • VipFilter required Single UPN or path to a CSV file with a UPN column.
  • DaysBack Audit lookback window in days. Default: 30.

Connects to: exchange-online

Grant-MailboxFullAccessreversibleGrant one or more users FullAccess on one or more mailboxes — open, read, and manage as if it were their own.
  • MailboxUPNs required One or more mailboxes to grant access on (often shared mailboxes).
  • DelegateUPNs required One or more users who'll get access.
  • AutoMapping When true (default), Outlook auto-attaches the mailbox in the delegate's profile. Set false to keep it hidden until they open it manually.

Connects to: exchange-online

Undo: @{script=Revoke-MailboxFullAccess; parameter_map=; confirm=Revoke Full Access on {MailboxUPNs} for {DelegateUPNs}?}

Grant-MailboxSendAsreversibleLet one or more users send messages that appear to come directly from one or more mailboxes (no "on behalf of" prefix).
  • MailboxUPNs required One or more mailboxes the users will be allowed to send AS.
  • DelegateUPNs required One or more users getting the SendAs right.

Connects to: exchange-online

Undo: @{script=Revoke-MailboxSendAs; parameter_map=; confirm=Revoke SendAs on {MailboxUPNs} for {DelegateUPNs}?}

Grant-SharedMailboxAccessreversibleGrant one or more users FullAccess, SendAs and/or SendOnBehalf on one or more shared mailboxes.
  • UserUPNs required One or more users receiving access.
  • SharedMailboxUPNs required One or more shared mailboxes to grant access to.
  • AccessLevels Access levels to grant: FullAccess, SendAs, or SendOnBehalf. Default: FullAccess and SendAs.
  • AutoMapping Attach the mailbox to the user's Outlook profile automatically (FullAccess only). Default: true.
  • AllowNonSharedMailbox Allow targets that are not shared mailboxes (user, room, equipment).

Connects to: exchange-online

Undo: @{script=Revoke-SharedMailboxAccess; parameter_map=; confirm=Revoke {AccessLevels} on {SharedMailboxUPNs} for {UserUPNs}?}

Manage-DistributionListOwnersreversibleLists, adds or removes the owners (ManagedBy) of distribution lists and mail-enabled security groups. Owners are who may manage membership and whose self-service requests Update-DistributionListMembership accepts. Keeps existing owners on Add, refuses to leave a list with none on Remove, skips Microsoft 365 and directory-synced groups with the reason.
  • GroupIds required One or more lists - display name, alias, SMTP address, or GUID. Right-click a group in M365 search to add it.
  • Action List shows the owners. Add and Remove change them.
  • Owners Owners to add or remove (UPN or SMTP address). A group as owner makes all its members owners. Required for Add and Remove.
  • DryRun Preview the owner changes without changing anything.

Connects to: exchange-online

Undo: @{script=Manage-DistributionListOwners; parameter_map=; confirm=Undo the owner change on {GroupIds} for {Owners}?}

Manage-EmailForwardingInspect or change a mailbox's auto-forwarding settings (mailbox-level + inbox rules).
  • UserPrincipalName required Mailbox you're inspecting or changing. Example: alex@contoso.com
  • Action Audit reports current forwards. DisableForwarding clears the mailbox setting. SetForwardTo points forwarding at a new address.
  • ForwardToAddress Destination SMTP address. Used only with SetForwardTo. Example: backup@contoso.com
  • DisableInboxRules When true, also disables any inbox rules that forward externally. Default true (safer).
  • Force Skip confirmation prompts.

Connects to: exchange-online

Manage-InboxRulesLists a mailbox's inbox rules, or disables the ones that forward outside the organisation or hide mail from the owner - kept for evidence, not deleted. Can re-enable or delete named rules.
  • UserPrincipalName required Mailbox whose rules to check.
  • Action Audit lists every rule. DisableSuspicious turns off rules that forward outside or hide mail, keeping them as evidence. EnableRules / RemoveRules act on -RuleNames.
  • RuleNames EnableRules / RemoveRules: the rule names to act on.
  • DryRun Preview without changing anything.

Connects to: exchange-online

Manage-MailboxPermissionsAudit or change who has FullAccess on one or more mailboxes, with optional SendAs grant.
  • MailboxUPNs required One or more mailboxes whose permissions you're managing.
  • Action Audit lists current non-inherited permissions. Grant/Remove changes them.
  • DelegateUPNs Users receiving (or losing) the permission. Required for any Grant/Remove action.
  • RemoveAll Wipe every non-inherited permission on the mailbox. Use with care — destructive.

Connects to: exchange-online

Manage-ResourceMailboxLifecycleEnables, hides, archives, or deletes one or all resource mailboxes.
  • ResourceFilter required Alias, identity, or 'All'.
  • Action Enable, Disable, Archive, or Delete. Default Disable.
  • DryRun Preview without executing.

Connects to: exchange-online

Manage-RoomDelegatesGrant or revoke FullAccess (calendar management) or booking-approver rights on a room or equipment mailbox.
  • ResourceIdentity required Resource mailbox to modify. Example: boardroom-a@contoso.com
  • DelegateUPN Person you're granting (or revoking from). Required for any Grant/Revoke action. Example: facilities@contoso.com
  • Action FullAccess opens the calendar in Outlook. Booking lets the delegate approve booking requests for the resource.

Connects to: exchange-online

New-BulkMailboxesAndGroupsCreates shared mailboxes (with Full Access / Send As), distribution groups and mail-enabled security groups from a CSV. Existing recipients are brought up to date instead of duplicated.
  • CsvPath required CSV of recipients. Headers: Type (Shared|Distribution|Security), Address, DisplayName, Members (';'), SendAs (';'), ManagedBy (';').
  • DryRun Preview the recipients and permissions that would change without changing anything.

Connects to: exchange-online

New-BulkResourceMailboxesCreates room and equipment mailboxes from a CSV with capacity, location and auto-accept booking. Skips addresses that already exist.
  • CsvPath required CSV of resources. Headers: DisplayName, Alias, Address, Type (Room|Equipment), Capacity, Location, AutoAccept.
  • DryRun Preview the resources that would be created without changing anything.

Connects to: exchange-online

New-SharedMailboxreversibleCreates one or more shared mailboxes by display name, with the address made from the name at the tenant's default domain. Skips ones that already exist; reversible.
  • Names required Display names of the shared mailboxes to create, e.g. Customer Care. The address becomes customercare@<domain>.
  • Aliases Aliases in the same order as Names. Default: each name lower-cased without spaces.
  • Domain Email domain for the new addresses. Default: the tenant's default accepted domain.
  • DryRun Show the mailboxes that would be created without creating anything.

Connects to: exchange-online

Undo: @{script=Remove-SharedMailbox; parameter_map=; confirm=Delete the shared mailboxes {Names}? Exchange keeps them recoverable for 30 days.}

Remove-CalendarPermissionreversibleRemove one or more users' access to one or more mailbox calendars. Reverse of Add-CalendarPermission.
  • MailboxUPNs required One or more mailboxes whose calendar is shared.
  • UserUPNs required One or more users losing calendar access. Default and Anonymous cannot be removed.

Connects to: exchange-online

Undo: @{script=Add-CalendarPermission; parameter_map=; confirm=Grant calendar access to {MailboxUPNs} back to {UserUPNs}? The access level defaults to Reviewer — set AccessRights to match what was removed.}

Remove-DistributionGroupMemberreversibleRemoves one or more recipients from one or more Exchange distribution or mail-enabled security groups. Idempotent — skips recipients that are not members, and skips Microsoft 365, dynamic, and directory-synced groups with the reason.
  • GroupIds required One or more distribution or mail-enabled security groups — display name, alias, SMTP address, or GUID. Right-click a group in M365 search to add it to the list.
  • UserUPNs required One or more recipients to remove. Right-click users in M365 search to stack them.
  • BypassManagerCheck When true, removes from groups the running account does not manage. Requires the Security Group Creation and Membership role; leave false unless a removal fails the manager check.

Connects to: exchange-online

Undo: @{script=Add-DistributionGroupMember; parameter_map=; confirm=Add {UserUPNs} back to {GroupIds}?}

Remove-MailboxAliasreversibleRemove one or more secondary SMTP aliases from one or more cloud mailboxes. Reverse of Add-MailboxAlias.
  • MailboxUPNs required One or more mailboxes to remove the aliases from.
  • Aliases required One or more alias addresses to remove, e.g. sales@contoso.com. The primary SMTP address is never removed.

Connects to: exchange-online

Undo: @{script=Add-MailboxAlias; parameter_map=; confirm=Add alias {Aliases} back to {MailboxUPNs}?}

Remove-ResourceDelegatereversibleRemove one or more people as booking delegates from one or more room or equipment mailboxes. Reverse of Add-ResourceDelegate.
  • ResourceUPNs required One or more room or equipment mailboxes.
  • DelegateUPNs required One or more delegates to remove.
  • ClearForwarding Turn off ForwardRequestsToDelegates on resources left with no delegates.
  • AllowNonResourceMailbox Allow targets that are not room or equipment mailboxes.

Connects to: exchange-online

Undo: @{script=Add-ResourceDelegate; parameter_map=; confirm=Add {DelegateUPNs} back as delegate(s) on {ResourceUPNs}?}

Remove-SharedMailboxreversibleDeletes one or more shared mailboxes (recoverable for 30 days). Refuses user, room and equipment mailboxes. Reverse of New-SharedMailbox.
  • Mailboxes required Shared mailboxes to delete, by display name, alias or address.
  • DryRun Show what would be deleted without deleting anything.

Connects to: exchange-online

Undo: @{script=New-SharedMailbox; parameter_map=; confirm=Recreate the shared mailboxes {Mailboxes}? (A new, empty mailbox - use Undo-SoftDeletedMailbox to recover the old content.)}

Rename-ResourceMailboxRenames a room or equipment resource mailbox — display name, object name, alias, primary SMTP address, and UPN — validating every value before writing anything.
  • Identity required The resource mailbox to rename.
  • NewDisplayName New display name shown in the room finder and on invitations.
  • NewName New directory object name.
  • NewAlias New Exchange alias / mail nickname.
  • NewPrimarySmtpAddress New primary SMTP address. Must be in an accepted domain and unused.
  • NewUserPrincipalName New user principal name for the underlying account.
  • UpdateUserPrincipalName Keep the UPN aligned with the new primary SMTP address. Default: true.
  • RemoveOldAddress Delete the old address instead of keeping it as an alias. Mail sent to it will bounce.
  • AllowNonResourceMailbox Allow targets that are not room or equipment mailboxes.
  • DryRun Preview the rename without changing anything.

Connects to: exchange-online

Revoke-MailboxFullAccessreversibleRemove one or more users' FullAccess permission from one or more mailboxes.
  • MailboxUPNs required One or more mailboxes to remove access from.
  • DelegateUPNs required One or more users whose access is being revoked.

Connects to: exchange-online

Undo: @{script=Grant-MailboxFullAccess; parameter_map=; confirm=Restore Full Access on {MailboxUPNs} for {DelegateUPNs}?}

Revoke-MailboxSendAsreversibleRemove one or more users' SendAs permission from one or more mailboxes.
  • MailboxUPNs required One or more mailboxes the users can currently send AS.
  • DelegateUPNs required One or more users whose SendAs right is being revoked.

Connects to: exchange-online

Undo: @{script=Grant-MailboxSendAs; parameter_map=; confirm=Restore SendAs on {MailboxUPNs} for {DelegateUPNs}?}

Revoke-SharedMailboxAccessreversibleRevoke FullAccess, SendAs and/or SendOnBehalf from one or more users on one or more shared mailboxes. Reverse of Grant-SharedMailboxAccess.
  • UserUPNs required One or more users losing access.
  • SharedMailboxUPNs required One or more shared mailboxes to revoke access on.
  • AccessLevels Access levels to revoke: FullAccess, SendAs, or SendOnBehalf. Default: all three.
  • AllowNonSharedMailbox Allow targets that are not shared mailboxes (user, room, equipment).

Connects to: exchange-online

Undo: @{script=Grant-SharedMailboxAccess; parameter_map=; confirm=Grant {AccessLevels} on {SharedMailboxUPNs} back to {UserUPNs}?}

Set-BulkOutOfOfficeConfigures internal/external auto-reply (OOF) messages on one, many, or all mailboxes, with optional scheduling.
  • TargetMailboxes required Comma-separated UPNs or 'All'.
  • InternalMessage required Internal auto-reply body.
  • ExternalMessage External auto-reply body.
  • StartTime Schedule start (when AutoReplyState=Scheduled).
  • EndTime Schedule end (when AutoReplyState=Scheduled).
  • AutoReplyState Enabled, Disabled, or Scheduled. Default Enabled.

Connects to: exchange-online

Set-BulkResourceMailboxSettingsBulk-applies hide-from-address-list and retention policy across resource mailboxes.
  • ResourceFilter required 'All' or a specific alias.
  • HideFromAddressList Hide from address lists. Default false.
  • RetentionPolicy Retention policy name to apply.

Connects to: exchange-online

Set-MailboxSendOnBehalfAdd or remove Send-on-Behalf grants for one or more users on one or more mailboxes. Outgoing messages show "Delegate on behalf of Mailbox". Other existing grants are preserved.
  • MailboxUPNs required One or more mailboxes the users will send on behalf of.
  • DelegateUPNs required One or more users being added or removed.
  • Action Grant adds users to the on-behalf list; Revoke removes them. Other delegates are untouched.

Connects to: exchange-online

Set-ResourceMailboxAttributesSets capacity, location, phone, and equipment type on one or more resource mailboxes (same values applied to all).
  • ResourceIdentities required One or more resource mailbox aliases or UPNs.
  • Capacity Resource capacity (seats).
  • Location Office/location string.
  • Phone Phone number.
  • EquipmentType Stored in CustomAttribute1.

Connects to: exchange-online

Set-RoomBookingPolicyConfigures calendar processing and booking policy on a resource mailbox.
  • ResourceIdentity required Resource mailbox alias or UPN.
  • BookingPolicy AutoAccept, AutoDecline, or ManualApproval. Default AutoAccept.
  • MaximumDurationMinutes Max booking length. Default 480.
  • BookingWindowDays How far in advance bookings are accepted. Default 180.
  • DeclineConflicts Disallow overlapping bookings.

Connects to: exchange-online

Sync-RoomBookingsSyncs bookings into a room from a CSV or exports current calendar folder properties.
  • ResourceIdentity required Resource mailbox alias or UPN.
  • Action SyncWithCSV or ExportBookings. Default SyncWithCSV.
  • CsvPath CSV with bookings (when Action=SyncWithCSV).

Connects to: exchange-online

Update-DistributionListMembershipOwner-verified bulk add/remove of distribution list members from a CSV. Proves the requester owns the list (ManagedBy) before changing anything, then applies one row per change (Action, Member). Built for self-service forms: a ticket system calls Verify on submit and Apply with the attachment. Refuses Microsoft 365, dynamic and directory-synced lists with the reason.
  • GroupId required The distribution list - display name, alias, SMTP address, or GUID.
  • RequestedBy required UPN or SMTP address of the person asking. Must be an owner of the list (directly, or through a group that owns it) or the run is refused.
  • Action Verify only confirms the requester owns the list. Apply verifies, then processes the CSV.
  • CsvPath The changes as CSV. Either Action,Member (one row per Add or Remove) or a single Member column that is the whole list as it should be (adds and removes are worked out). Needed for Apply unless CsvText is given.
  • CsvText The same CSV as text, header row first, for callers that send the attachment inline (ServiceNow Flow, Jira automation) instead of uploading a file.
  • DryRun Preview the adds and removes without changing the list.

Connects to: exchange-online

Entra ID 35

Add-M365LicensereversibleAssigns one or more Microsoft 365 licenses to one or more users by SKU part number or GUID. Checks available seats and usage location first; skips licenses already assigned.
  • UserUPNs required One or more users to license.
  • SkuPartNumbers required One or more SKU part numbers or SKU GUIDs, e.g. ENTERPRISEPACK, SPE_E3.
  • UsageLocation Two-letter ISO country code to set on users that have no usage location, e.g. US. Required before Entra will license a user.
  • DisabledPlans Service plan names to leave switched off within the assigned SKUs, e.g. YAMMER_ENTERPRISE.
  • DryRun Preview the assignments without changing anything.

Connects to: graph

Undo: @{script=Remove-M365License; parameter_map=; confirm=Remove license {SkuPartNumbers} from {UserUPNs}?}

Add-UserToGroupreversibleAdds one or more users to one or more Entra ID / Microsoft 365 groups. Idempotent — skips existing memberships, and skips dynamic, directory-synced, and Exchange-owned groups with the reason.
  • GroupIds required One or more target group GUIDs or display names. Right-click a group in M365 search to add it to the list.
  • UserUPNs required One or more users to add. Right-click users in M365 search to stack them.

Connects to: graph

Undo: @{script=Remove-UserFromGroup; parameter_map=; confirm=Remove {UserUPNs} from {GroupIds}?}

Audit-GroupGuestAccessLists guest/external members of one or all groups; optionally removes them.
  • GroupFilter required 'All' or a group GUID.
  • RemoveGuests Remove guests after listing.

Connects to: graph

Block-M365UserSignInreversibleBlocks Microsoft 365 sign-in for one or more users and revokes every session, for a lost or stolen device or a compromised account. Reversible with Unblock-M365UserSignIn.
  • UserUPNs required One or more users to lock out.
  • KeepSessions Block new sign-ins but leave existing sessions alone.
  • DryRun Preview without changing anything.

Connects to: graph

Undo: @{script=Unblock-M365UserSignIn; parameter_map=; confirm=Allow {UserUPNs} to sign in again?}

Connect-PowerScriptsTenantRun this first, and again any time to repair. You sign in to Microsoft as an admin; it sets up the app PowerScripts uses in your tenant (permissions, admin consent, Exchange roles and a certificate) and saves the tenant here. Re-runs update the app this install already uses - nothing is duplicated.
  • Alias Name for this tenant in PowerScripts. Filled in with the saved name; for a new tenant, defaults to your organisation's name.
  • Tenant Tenant ID or domain. Filled in with the tenant already saved here; enter a different one to add a second tenant.
  • PowerScriptsUrl This site's address, for Microsoft sign-in. Filled in for you.
  • ClientId Client ID of the app to update. Filled in for you with the app this PowerScripts already uses, so a re-run repairs it instead of making a second one. Leave blank for a new tenant.
  • GraphPermissions Microsoft Graph permissions to grant. The recommended set is ticked; untick any you do not want, or tick extras. Nothing ticked means the recommended set.
  • ExchangeRoles Entra directory roles for the app. The three ticked are what help-desk scripts need: Exchange Online needs Global Reader to connect, audit search needs Compliance Administrator, and anything that changes Exchange needs Exchange Administrator.
  • PreviewOnly Sign in and show what would change, without changing anything.
  • RemoveUnticked Also remove permissions the app has that are not in the list.
  • NoCertificate Skip the certificate. Only Microsoft Graph will work.
  • AlsoCreateSecret Also make a client secret. Not needed with the certificate.
  • ReplaceExistingCertificates Replace certificates on the app that cannot be kept.

Runs on the PowerScripts server; no connection needed.

Convert-GroupTypeConverts one or more groups between Microsoft 365 unified, security, and mail-enabled types.
  • GroupIds required One or more target group GUIDs.
  • ConversionType required ToM365Group, ToSecurityGroup, or ToMailEnabled.

Connects to: graph

Get-AppRegistrationCertificateExpirationLists Entra ID app registration certificates with days until expiry and an EXPIRED/CRITICAL/WARN/OK status, soonest first. Optionally covers SAML signing certificates on service principals.
  • ApplicationFilter App object ids, application ids, display names, or 'All'. Default: All.
  • DaysAhead Only report certificates expiring within this many days, plus already-expired ones. Default: 60.
  • IncludeAll Report every certificate regardless of expiry date.
  • WarnDays Days remaining at or below which a certificate is WARN. Default: 30.
  • CriticalDays Days remaining at or below which a certificate is CRITICAL. Default: 7.
  • IncludeServicePrincipals Also check certificates on service principals, where SAML token-signing certificates live.
  • IncludeOwners Include each application's owners — one extra Graph call per application.
  • OutputFormat Table, Object, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: AppCertificateExpiration.csv.

Connects to: graph

Get-AppRegistrationSecretExpirationLists Entra ID app registration client secrets with days until expiry and an EXPIRED/CRITICAL/WARN/OK status, soonest first.
  • ApplicationFilter App object ids, application ids, display names, or 'All'. Default: All.
  • DaysAhead Only report secrets expiring within this many days, plus already-expired ones. Default: 60.
  • IncludeAll Report every secret regardless of expiry date.
  • WarnDays Days remaining at or below which a secret is WARN. Default: 30.
  • CriticalDays Days remaining at or below which a secret is CRITICAL. Default: 7.
  • IncludeServicePrincipals Also check secrets held on service principals.
  • IncludeOwners Include each application's owners — one extra Graph call per application.
  • OutputFormat Table, Object, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: AppSecretExpiration.csv.

Connects to: graph

Get-EntraSignInReportExports Entra sign-in logs over a lookback window to CSV or JSON.
  • DaysBack Lookback window in days. Default 7.
  • OutputFormat CSV or JSON. Default CSV.

Connects to: graph

Get-GroupAuditReportGenerates a Membership, Activity, or AllGroups report and exports to CSV/JSON.
  • ReportType Membership, Activity, or AllGroups. Default Membership.
  • OutputFormat CSV or JSON. Default CSV.

Connects to: graph

Get-GroupMembershipLists the members (and optionally owners) of one or more Entra ID / Microsoft 365 groups, flagging guests, disabled accounts, and nested groups.
  • GroupIds required One or more group GUIDs or display names.
  • Recursive Expand nested groups and report every effective member.
  • IncludeOwners Also list the group's owners.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: GroupMembership.csv.

Connects to: graph

Manage-AppRegistrationCreates a new single-tenant app registration or deletes one by ID.
  • Action required Create, Update, or Delete.
  • AppName Display name for new apps.
  • AppId Application object ID for delete/update.

Connects to: graph

Manage-ConditionalAccessPolicyCreates a Conditional Access policy (MFA-required) or disables an existing one.
  • Action required Create, Update, Enable, or Disable.
  • PolicyName Display name for new policies.
  • PolicyId Policy GUID for update/disable.

Connects to: graph

Manage-DirectorySyncRead-only Entra Connect health check: whether directory sync is on, last sync and password sync times, flags a stale sync, lists synced users with provisioning errors, and prints the Start-ADSyncSyncCycle command to run on the Entra Connect server (there is no cloud API to trigger a sync).
  • StaleAfterHours Flag the sync as stale when the last cycle is older than this many hours (1-168). Default: 3.
  • MaxErrorsShown Most provisioning errors to list (0 = all). Default: 50.

Connects to: graph

Manage-EntraDevicesDeletes or updates compliance state on one or all Entra-joined/hybrid devices.
  • DeviceFilter required Device ID or 'All'.
  • Action Delete or UpdateCompliance. Default Delete.

Connects to: graph

Manage-GroupLifecycleArchives, renews, or deletes one or more groups.
  • GroupFilters required One or more group GUIDs, or the literal value 'All'.
  • Action Archive, Renew, or Delete. Default Archive.
  • DryRun Preview without executing.

Connects to: graph

Manage-GroupOwnershipAssigns one or more owners across one or more groups; optionally deletes orphaned (ownerless) groups.
  • GroupFilters required One or more group GUIDs, or the literal value 'All'.
  • NewOwnerUPNs Users to add as owners on every matched group.
  • RemoveOrphaned Delete groups that have zero owners.

Connects to: graph

Manage-GroupPermissionsGrant or revoke SendAs across one or more groups, or add and remove one or more owners.
  • GroupIds required One or more groups to modify. Right-click groups in M365 search to stack them.
  • DelegateUPNs Users receiving (or losing) the permission. Required for all actions.
  • Action required GrantSendAs / RevokeSendAs control SendAs on the group address. GrantOwner / RevokeOwner add and remove the user as a group admin (via Graph). The last remaining owner is never removed.

Connects to: graph, exchange-online

Manage-GuestUserLifecycleProvisions guest invitations, expires pending guests, or removes a guest user.
  • Action required Provision, Expire, or Remove.
  • GuestEmail Email/UPN of the guest.
  • ExpirationDays Pending-state expiration window. Default 90.

Connects to: graph

Manage-UserMfaLists each user's registered MFA / authentication methods, or removes chosen method types (phone, Authenticator, FIDO2, OATH, ...) so the user re-registers, optionally signing them out everywhere. Admin accounts need the app to hold Privileged Authentication Administrator.
  • UserUPNs required One or more users to report on or reset.
  • Action Report lists methods; RemoveMethods deletes the chosen method types. Default: Report.
  • MethodTypes Method types to remove with RemoveMethods. The password method is never removed. Default: Phone, MicrosoftAuthenticator.
  • RevokeSessions Sign the user out of every session so they re-register at next sign-in.
  • DryRun Preview without changing anything.

Connects to: graph

Manage-UserOnboardingMicrosoft 365 joiner and leaver. Onboard creates the account with a copy-once password, manager, and a colleague's groups and Teams. Offboard blocks sign-in, revokes sessions, hands groups the leaver owned alone to their manager, and removes them from every group and Team.
  • Action required Onboard (joiner) or Offboard (leaver).
  • UserPrincipalName required The joiner's or leaver's UPN.
  • DisplayName Onboard: display name. Default: GivenName Surname.
  • GivenName Onboard: first name.
  • Surname Onboard: last name.
  • JobTitle Onboard: job title.
  • Department Onboard: department.
  • ManagerUPN Onboard: the manager to set. Offboard: who takes over groups the leaver owned alone (default: their manager).
  • CopyGroupsFrom Onboard: copy Microsoft 365 groups, Teams and security groups from this colleague.
  • AddToGroups Onboard: more groups or Teams to add, by display name or id.
  • UsageLocation Onboard: two-letter usage location. Default: US.
  • DryRun Preview without changing anything.

Connects to: graph

New-BulkM365GroupsCreates Microsoft 365 groups from a CSV with owners and members, and optionally turns each into a Team. Existing groups are brought up to date instead of duplicated.
  • CsvPath required CSV of groups. Headers: DisplayName, MailNickname, Description, Visibility, Owners (';'), Members (';'), TeamEnabled.
  • Visibility Visibility for rows that leave it blank.
  • TeamRetrySeconds How long to keep retrying Team creation while a new group replicates.
  • DryRun Preview the groups, owners and members that would change without changing anything.

Connects to: graph

Remove-M365LicensereversibleRemoves one or more Microsoft 365 licenses from one or more users by SKU part number or GUID. Reverse of Add-M365License; reports group-inherited licenses instead of failing on them.
  • UserUPNs required One or more users to unlicense.
  • SkuPartNumbers required One or more SKU part numbers or SKU GUIDs, e.g. ENTERPRISEPACK, SPE_E3.
  • DryRun Preview the removals without changing anything.

Connects to: graph

Undo: @{script=Add-M365License; parameter_map=; confirm=Assign license {SkuPartNumbers} back to {UserUPNs}?}

Remove-UserFromGroupreversibleRemoves one or more users from one or more Entra ID / Microsoft 365 groups. Idempotent — skips users that aren't members, and skips dynamic, directory-synced, and Exchange-owned groups with the reason.
  • GroupIds required One or more target group GUIDs or display names. Right-click a group in M365 search to add it to the list.
  • UserUPNs required One or more users to remove. Right-click users in M365 search to stack them.

Connects to: graph

Undo: @{script=Add-UserToGroup; parameter_map=; confirm=Add {UserUPNs} back to {GroupIds}?}

Reset-M365UserPasswordResets the Microsoft 365 password for one or more cloud users, generating a strong random password per user (shown as a copyable secret) unless one is supplied. Forces a change at next sign-in by default and can sign the user out everywhere. Skips users synced from on-premises AD.
  • UserUPNs required One or more users whose password to reset.
  • Password Password to set on every user. Leave empty to generate a strong random password for each user.
  • NoForceChange Do not require the user to change the password at next sign-in.
  • RevokeSessions Also sign the user out of every session.
  • DryRun Preview without changing anything.

Connects to: graph

Send-NotificationTestChecks that PowerScripts can deliver results: the Output Email From mailbox and the app's Mail.Send permission for script email, and a Teams Workflow webhook URL for completion notifications. Read-only unless -SendTestEmail or -SendTestTeamsMessage is set, which send one labelled test message.
  • RecipientUPN required Who receives the test email. Also checked to exist in the tenant.
  • WebhookUrl A Teams Workflow webhook URL from a script's notification settings, to check it is valid and reachable.
  • SendTestEmail Send one labelled test email from the Output Email From mailbox to RecipientUPN.
  • SendTestTeamsMessage Post one labelled test card to WebhookUrl.

Connects to: graph

Set-BulkUsersAndLicensesCreates or updates Entra ID users from a CSV (name, title, department, usage location) and assigns a license only where a free seat exists. Safe to re-run.
  • CsvPath required CSV of users. Headers: UserPrincipalName, DisplayName, GivenName, Surname, JobTitle, Department, CompanyName, OfficeLocation, MailNickname, UsageLocation, License (SKU part number or GUID).
  • UsageLocation Two-letter usage location for rows that leave it blank. Required by Microsoft before a license can be assigned.
  • StartDisabled Create new users with sign-in blocked.
  • DryRun Preview the users and licenses that would change without changing anything.

Connects to: graph

Set-DynamicGroupRuleUpdates or reads a dynamic-membership rule on an Entra ID group.
  • GroupId required Target group GUID.
  • MembershipRule required Membership rule expression (e.g. user.department eq 'Sales').
  • Action UpdateRule or ValidateRule. Default UpdateRule.

Connects to: graph

Set-GroupPolicyApplies a sensitivity label, restricts guest access, or enforces naming on a group.
  • GroupId required Target group GUID.
  • PolicyAction required ApplySensitivityLabel, RestrictGuestAccess, or EnforceNaming.
  • SensitivityLabelId Label GUID when PolicyAction=ApplySensitivityLabel.

Connects to: graph

Set-PimRoleAssignmentGrants or removes an Eligible (default 30 days) or Active PIM role assignment for one or more users.
  • UserPrincipalNames required One or more user UPNs.
  • RoleName required Directory role display name.
  • AssignmentType Eligible or Active. Default Eligible.
  • Action Grant the assignment or Remove an existing one. Default Grant.

Connects to: graph

Sync-GroupMembershipReconciles a group's membership against a CSV, either adding only or fully replacing.
  • GroupId required Target group GUID.
  • MembershipCsv required CSV with a UPN column for desired members.
  • Mode Replace (prune extras) or AddOnly. Default AddOnly.

Connects to: graph

Test-AppCredentialHealthChecks the PowerScripts app registration's client secrets and certificates: expiry dates and days left, and whether each certificate is installed on this server with a private key the service account can use. Schedule it to get a warning before an expiry breaks every script at once. Read-only.
  • WarnDays Report secrets and certificates that expire within this many days.

Connects to: graph

Test-GraphConnectionVerifies the Microsoft Graph connection: tenant identity, app registration, granted scopes, and a live org read.
  • Verbose Reserved for future use.

Connects to: graph

Test-M365ConnectivityTroubleshoots the tenant connection as the app sees it: modules and versions, Graph, the app's Entra roles and their scope, Exchange Online and which cmdlets its role exposes, Security & Compliance, Teams and SharePoint. Ends with plain-English findings. Read-only.
  • CheckCmdlets Extra cmdlets to test for - for example the ones a failing script needs, such as New-DistributionGroup. For each one that is missing, the findings name the Exchange roles that include it.

Runs on the PowerScripts server; no connection needed.

Unblock-M365UserSignInreversibleAllows one or more blocked users to sign in to Microsoft 365 again. Reverse of Block-M365UserSignIn; revoked sessions are not restored.
  • UserUPNs required One or more users to allow back in.
  • DryRun Preview without changing anything.

Connects to: graph

Undo: @{script=Block-M365UserSignIn; parameter_map=; confirm=Block sign-in for {UserUPNs} again?}

Compliance 23

Close-LegalHoldCaseReleases a legal hold opened with Open-LegalHoldCase: removes the eDiscovery custodian and case holds, the fallback Litigation Hold and 'PowerScripts hold: <case>' retention policy, optionally the Litigation Hold asked for with the case (holds for other matters are left on and reported), and closes the case. Anything legal already released in Purview is reported as already released, never an error. The case stays open while other custodians remain in it.
  • CaseName required Case name used when the hold was opened.
  • Custodians Custodians to release (UPN or email). Empty = everyone held for the case.
  • ReleaseLitigationHold Also turn off the Litigation Hold placed with -AlsoLitigationHold for this case. Fallback Litigation Holds are always released; holds for other matters never are.
  • KeepCaseOpen Release the holds but leave the case open.
  • DryRun Show what would be released and closed without changing anything.

Connects to: graph, exchange-online, purview

Disable-LitigationHoldreversibleRemoves a litigation hold from a mailbox. Reversible from the run log, restoring the previous hold duration.
  • MailboxUPN required Mailbox to remove the hold from.
  • Reason Reason recorded for audit purposes.
  • RestoreDurationDays Used when reversing: duration to restore if re-enabling. 0 = indefinite.

Connects to: exchange-online

Undo: @{script=Enable-LitigationHold; parameter_map=; state_map=; confirm=Restore the litigation hold on {MailboxUPN}?}

Enable-LitigationHoldreversiblePlaces a mailbox on litigation hold, optionally for a fixed duration. Reversible from the run log.
  • MailboxUPN required Mailbox to place on hold.
  • DurationDays Hold duration in days. 0 or omitted = indefinite.
  • Reason Reason recorded on the mailbox for audit purposes.

Connects to: exchange-online

Undo: @{script=Disable-LitigationHold; parameter_map=; confirm=Remove the litigation hold from {MailboxUPN}?}

Export-UnifiedAuditLogSearches the unified audit log over a date range and exports to CSV or JSON.
  • StartDate required Inclusive start date.
  • EndDate required Inclusive end date.
  • Operations Operation filter or 'All'. Default All.
  • OutputFormat CSV or JSON. Default CSV.

Connects to: purview

Get-ComplianceGovernanceReportProduces a tenant-wide compliance governance summary: total legal holds, active eDiscovery cases, and retention policies.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: exchange-online, purview

Get-CrossServiceHoldOverviewProduces a combined count of litigation holds across mailboxes and SharePoint sites, exportable as CSV.
  • OutputFormat CSV or Grid. Default: CSV.

Connects to: exchange-online, sharepoint-online

Get-DlpHeldContentReportReports DLP rule matches in mail, SharePoint/OneDrive and Endpoint DLP from the Unified Audit Log (ComplianceDLPExchange, ComplianceDLPSharePoint, DLPEndpoint), optionally only the content DLP blocked or restricted, with counts per policy and rule. Replaces the retired Get-DlpIncidentReport. Read-only.
  • DaysBack Days to look back, 1-180. Default: 30.
  • Workload All, Exchange, SharePoint or Endpoint. Default: All.
  • OnlyBlockedOrHeld Only events where DLP blocked or restricted the content.
  • OutputFormat Table, CSV or JSON. Default: Table.

Connects to: exchange-online

Get-EDiscoveryCaseReportReports status and custodian counts for all eDiscovery cases, optionally filtered by case name.
  • CaseNameFilter Optional case name filter; omit to report all cases.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: purview

Get-EDiscoveryExportReportSummarises eDiscovery searches (query, estimate status, items, size, mailboxes, sites) and exports (status, progress, files and download links) for one case or every open case, through the Microsoft Graph eDiscovery API. Read-only.
  • CaseName eDiscovery case name. Empty = every case.
  • IncludeClosed Also include closed cases when reporting every case.
  • OutputFormat Table or CSV. Default: Table.

Connects to: graph

Get-HoldExpirationLists all mailboxes under litigation hold with their duration and owner to track upcoming hold expirations.
  • DaysToExpire Threshold window in days for flagging expiring holds. Default: 30.

Connects to: exchange-online

Get-HoldStatisticsReports litigation hold duration and owner for mailboxes and lock state for SharePoint sites.
  • Scope Mailbox, Site, or All. Default: All.

Connects to: exchange-online, sharepoint-online

Get-LegalHoldAuditLogSearches the unified audit log for HoldCreated and HoldRemoved operations from a specified start date.
  • StartDate required Start date for the audit log search (YYYY-MM-DD).
  • DaysBack Number of days back to search. Default: 30.

Connects to: purview

Get-LegalHoldReportReports all mailboxes and SharePoint sites currently under litigation hold, exportable as CSV or plain text.
  • HoldType Mailbox, Site, or All. Default: All.
  • OutputFormat CSV or Grid. Default: CSV.

Connects to: exchange-online, sharepoint-online

Get-PurviewReportCompliance reports: DLP rule matches (Unified Audit Log DLP record types, replacing the retired Get-DlpIncidentReport), sensitivity-label activity (MIPLabel audit records), or retention policy mode and distribution status. Read-only.
  • ReportType DLPIncidents, LabelActivity or RetentionEffectiveness. Default: DLPIncidents.
  • DaysBack Days to look back for the audit-log reports, 1-180. Default: 30.
  • OutputFormat Table, CSV or JSON. Default: Table.

Connects to: exchange-online, purview

Get-RetentionHoldReportReports retention and deletion hold policies with their applied locations, exportable as CSV or JSON.
  • HoldType Retention, Deletion, or All. Default: All.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: purview

Manage-DlpPolicyLists, creates, switches the mode of (simulation, enforce, off) or removes Microsoft Purview DLP policies across Exchange, SharePoint, OneDrive, Teams and devices. Create adds one rule for the given sensitive information types and starts in simulation. Replaces the retired Exchange New-DlpPolicy.
  • Action required List, Create, Update (set -Mode), Enable (enforce), Disable or Remove.
  • PolicyName Name of the policy to create.
  • PolicyIds Existing policy names or ids for Update, Enable, Disable or Remove.
  • Mode Mode for Create/Update. Default: TestWithNotifications (simulation with policy tips).
  • Locations Where a new policy applies. Default: Exchange, SharePoint, OneDrive, Teams.
  • SensitiveInfoTypes Sensitive information type names the new rule detects. Default: Credit Card Number, U.S. Social Security Number (SSN).
  • MinCount Matches of a type needed to trigger the rule. Default: 1.
  • BlockAccess Create: block access to matching content once the policy is enforced.
  • IncidentReportTo Create: addresses that receive an incident report on each match.
  • DryRun Preview without changing anything.

Connects to: purview

Manage-EDiscoveryCaseLists eDiscovery cases, creates cases and searches (over given mailboxes and sites, or the whole tenant), runs estimates, starts exports or closes a case, through the Microsoft Graph eDiscovery API (app-only supported).
  • Action required List, CreateCase, CreateSearch, Estimate, Export or Close.
  • CaseName eDiscovery case name (every action except List).
  • SearchName Search name inside the case (CreateSearch, Estimate, Export).
  • Query KQL query for CreateSearch. Default subject:'confidential'.
  • Mailboxes Mailboxes to search. Empty with no Sites = every mailbox and site.
  • Sites SharePoint or OneDrive site URLs to search.
  • ExportFormat Mail format for Export: pst or msg. Default: pst.
  • DryRun Preview without changing anything.

Connects to: graph

Manage-RetentionPolicyCreates a tenant-wide retention policy, scopes it to one or more locations, or deletes it.
  • Action required Create, Assign, or Delete.
  • PolicyName Policy display name.
  • TargetIdentities Mailboxes/sites to add when Action=Assign.

Connects to: purview

New-EDiscoveryCaseHoldreversibleCreates (or reuses) a Purview eDiscovery case and puts mailboxes, sites and Microsoft 365 groups or Teams on hold in it, optionally only for content matching a query. Uses the Microsoft Graph eDiscovery API (app-only supported). Re-running adds locations; reversible.
  • CaseName required eDiscovery case name. Created if it does not exist.
  • CaseDescription Description for a new case (ignored when the case exists).
  • HoldName Hold name inside the case. Default: '<CaseName> hold'.
  • Mailboxes Mailboxes to hold (UPN or SMTP address).
  • Sites SharePoint or OneDrive site URLs to hold.
  • Groups Microsoft 365 groups or Teams to hold, by mail address. Holds the group mailbox and its site.
  • Query KQL query limiting the hold to matching content, e.g. subject:"Project Erie". Empty = hold everything.
  • DryRun Show the case, hold and locations that would be set without changing anything.

Connects to: graph

Undo: @{script=Remove-EDiscoveryCaseHold; parameter_map=; confirm=Take these locations off the hold in case {CaseName}?}

Open-LegalHoldCasereversibleOpens a legal hold for a legal or HR request: creates (or reuses) a Purview eDiscovery case, adds the people as custodians and holds their mail, OneDrive and any extra sites - everything, or only content matching keywords and a date range. Optionally also turns on Exchange Litigation Hold. When the tenant is not licensed for eDiscovery (Premium) it places a fallback hold that works on E3: mailbox Litigation Hold plus a retain-only Purview retention policy on each custodian's OneDrive and the sites. Prints what is held per person and how legal or IT can release it. Reversible with Close-LegalHoldCase.
  • CaseName required Case name, e.g. the matter or ticket name. Reused if an open case has this name; a closed one is reopened.
  • Description Description for a new case (ignored when the case exists).
  • Custodians required People whose content is held (UPN or email).
  • Sites Extra SharePoint, OneDrive or Teams site URLs to hold.
  • Keywords KQL keywords, e.g. "Project Erie" OR subject:invoice. When set, only matching content is held. Empty = hold everything. Not applied by the fallback hold.
  • StartDate Only hold content from this date. Added to the hold query.
  • EndDate Only hold content up to this date. Added to the hold query.
  • AlsoLitigationHold Also turn on Exchange Litigation Hold on each custodian mailbox (owner recorded as this case). Needs Exchange Administrator.
  • LitigationHoldDays Litigation Hold duration in days. 0 or empty = until released.
  • NoFallbackHold If eDiscovery (Premium) is not licensed or not permitted, do NOT place the fallback hold (mailbox Litigation Hold + retention policy on OneDrive and sites). By default the fallback is placed.
  • DryRun Show the case, custodians and holds that would be set without changing anything.

Connects to: graph, exchange-online, purview

Undo: @{script=Close-LegalHoldCase; parameter_map=; confirm=Release the holds on {Custodians} and close case {CaseName}?}

Remove-EDiscoveryCaseHoldreversibleTakes mailboxes, sites or Microsoft 365 groups / Teams off an eDiscovery case hold, and removes the hold once it is empty. Uses the Microsoft Graph eDiscovery API (app-only supported). Reverse of New-EDiscoveryCaseHold.
  • CaseName required eDiscovery case name.
  • HoldName Hold name. Default: '<CaseName> hold'.
  • Mailboxes Mailboxes to release (UPN or SMTP address).
  • Sites SharePoint or OneDrive site URLs to release.
  • Groups Microsoft 365 groups or Teams to release, by mail address.
  • DryRun Show what would be released without changing anything.

Connects to: graph

Undo: @{script=New-EDiscoveryCaseHold; parameter_map=; confirm=Put these locations back on hold in case {CaseName}?}

Search-M365ContentFinds mail and files matching keywords, sender, subject and dates in chosen mailboxes, OneDrives and sites. With eDiscovery Premium it runs a Microsoft Purview eDiscovery search (it appears in Purview > eDiscovery, ready to refine, export or hold) and reports counts and sizes; otherwise a quick Graph search lists each hit (mailbox, folder, date, sender, subject, link - never message bodies) and creates nothing in Purview.
  • Keywords required Words or phrases to find (KQL), e.g. project-x OR "quarterly report".
  • Mailboxes Mailboxes to search. Their OneDrive is searched too unless No files is ticked.
  • AllMailboxes Search every mailbox (and, with files, every site). The quick search goes mailbox by mailbox and can be slow.
  • Sites SharePoint or OneDrive site URLs to search.
  • NoFiles Mail only - do not search OneDrive or SharePoint files.
  • From Only mail from this sender (address or name).
  • Subject Only mail whose subject contains this text.
  • StartDate Earliest date, yyyy-MM-dd.
  • EndDate Latest date, yyyy-MM-dd.
  • Engine Auto tries Purview eDiscovery and falls back to the quick search; eDiscovery or Quick forces one.
  • CaseName Purview eDiscovery case for the search (created if missing).
  • Region Quick file search region (app-only search needs one): NAM, EUR, APC, GBR, CAN, AUS... Default NAM.
  • MaxResults Quick search: stop after this many hits. Default 500.
  • OutputPath Also write every hit to this CSV file.

Connects to: graph

Set-SensitivityLabelApplies a sensitivity label to a mailbox or SharePoint site, or reports a label's settings.
  • TargetIdentity required Mailbox identity or site URL.
  • LabelId Label GUID.
  • TargetType Mailbox, Site, OneDrive, or Team. Default Mailbox.
  • Action Apply or Report. Default Apply.

Connects to: purview, exchange-online, sharepoint-online

Teams 18

Add-TeamMemberreversibleAdds users to one or more teams as members or owners, promoting existing members in place rather than duplicating them. Idempotent, and reports guest additions the tenant policy blocks.
  • TeamIds required One or more teams (group id or display name).
  • UserUPNs required One or more users (UPN or object id).
  • Role Member or Owner. Default: Member.
  • DryRun Preview the memberships that would be added without changing anything.

Connects to: graph

Undo: @{script=Remove-TeamMember; parameter_map=; confirm=Remove {UserUPNs} from team {TeamIds}?}

Audit-TeamsGuestAccessLists external/guest members across one team or all teams.
  • TeamFilter required Team ID or 'All'.
  • ExportReport Emit a final 'report generated' marker.

Connects to: graph

Copy-TeamClones a team (channels, tabs, apps, settings, optionally members) into a new team with the Teams clone operation, waits for it to finish, and adds the owners you name. Messages and files are not copied. Needs Graph Team.Create and Team.ReadBasic.All, plus TeamMember.ReadWrite.All and User.Read.All for OwnerUPNs.
  • SourceTeamId required Source team group id.
  • TargetTeamName required Display name for the new team.
  • Description Description for the new team. Default: the source team's description.
  • Visibility Private or Public. Blank keeps the source team's visibility.
  • IncludeMembership Also copy the source team's members and owners.
  • OwnerUPNs Owners for the new team, added after the clone (guards against the known ownerless-clone issue).
  • WaitSeconds How long to wait for the clone to finish. Default 300.
  • DryRun Preview the clone without creating anything.

Connects to: graph

Get-TeamsInactiveTeamsReports teams with no activity in the chosen window using the Microsoft 365 usage reports, with message and meeting counts, creation date, and optionally the owners to contact. Read-only; feeds Manage-TeamArchival.
  • DaysInactive Days without activity before a team is reported. Default: 90.
  • Period Usage report window: D7, D30, D90 or D180. Default: D90.
  • IncludeOwners Also list each inactive team's owners - one Graph call per team reported.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: InactiveTeams.csv.

Connects to: graph

Get-TeamsMessageActivityRetrieves recent channel or private chat messages for a Teams team or chat thread via Graph.
  • TeamId Team GUID (required when TargetType=Channel).
  • ChatId Channel ID or Chat ID depending on TargetType.
  • DaysBack Number of days back to retrieve messages. Default: 30.
  • TargetType Channel or Chat. Default: Channel.

Connects to: graph

Get-TeamsOwnershipReportReports every team's ownership with a risk flag - ownerless, owners all disabled, single owner, or guest owner - plus member and guest counts. Read-only; feeds Add-TeamMember -Role Owner.
  • RiskyOnly Only report teams carrying a risk flag.
  • IncludeNonTeamGroups Also report Microsoft 365 groups that are not teams.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: TeamsOwnership.csv.

Connects to: graph

Get-TeamsUsageReportGenerates a TeamActivity, ChannelUsage, or Membership report and exports to CSV/JSON.
  • ReportType TeamActivity, ChannelUsage, or Membership. Default TeamActivity.
  • OutputFormat CSV or JSON. Default CSV.

Connects to: graph

Manage-TeamArchivalArchives, unarchives or deletes teams in bulk (by id or display name; 'All' for archive/unarchive). Skips teams already in the requested state; deleted teams stay restorable for 30 days. Needs Graph TeamSettings.ReadWrite.All and Group.Read.All, plus Group.ReadWrite.All to delete.
  • TeamFilters required One or more team ids or display names, or 'All' (Archive and Unarchive only).
  • Action Archive, Unarchive or Delete. Default Archive.
  • DryRun Preview the teams that would change without changing anything.

Connects to: graph

Manage-TeamMembershipAdds or removes a member or owner on a Microsoft Team (RemoveOwner demotes to member). Idempotent and never removes the last owner. Needs Graph TeamMember.ReadWrite.All and User.Read.All.
  • TeamId required Team to modify. Right-click a team in M365 search to drop in the GUID.
  • UserPrincipalName required User to add or remove. Example: jane@contoso.com
  • Action AddMember, AddOwner (adds or promotes), RemoveMember (leaves the team) or RemoveOwner (demotes to member).
  • DryRun Preview the change without making it.

Connects to: graph

Manage-TeamsMeetingsSchedules Teams meetings as calendar events with a Teams join link on organizers' calendars (invitations sent by Exchange), lists upcoming Teams meetings with their join links, or cancels them by event id or subject. Needs only Graph Calendars.ReadWrite; attendance reports are not offered because the onlineMeetings API requires a Teams application access policy.
  • OrganizerUPNs required One or more organizer UPNs.
  • Action Schedule, List or Cancel. Default Schedule.
  • Subject Meeting subject (Schedule), or exact subject of the meetings to cancel (Cancel).
  • StartTime Meeting start, read in TimeZone (Schedule).
  • DurationMinutes Length in minutes. Default 60.
  • TimeZone Windows time zone name for StartTime, e.g. 'Eastern Standard Time'. Default: the PowerScripts server's time zone.
  • AttendeeEmails Attendee email addresses (Schedule).
  • Agenda Agenda text for the invitation (Schedule).
  • EventIds Event ids to cancel, as shown by List (Cancel).
  • DaysAhead How many days ahead List and Cancel-by-subject look. Default 14.
  • CancelComment Message included in the cancellation notice.
  • DryRun Preview what would be scheduled or cancelled without changing anything.

Connects to: graph

Manage-TeamsMessagingPolicyLists Teams messaging policies, audits which policy users are on, or assigns a policy to users (printing the previous one so it can be undone). Uses Teams PowerShell app-only, which requires the PowerScripts app to hold the Teams Administrator directory role: run Connect Microsoft 365 and tick Teams Administrator.
  • Action List (all policies), Audit (each user's policy) or Assign. Default List.
  • UserUPNs Users to audit or assign (UPN). Required for Audit and Assign.
  • PolicyName Messaging policy to assign when Action=Assign. 'Global' removes the direct assignment so the org-wide default applies.
  • DryRun Preview the assignments without changing anything.

Connects to: teams

New-BulkTeamsCreates Teams from a CSV: the Microsoft 365 group, owners and members, the Team, and extra standard channels. Re-running adds what is missing and never removes.
  • CsvPath required CSV of teams. Headers: DisplayName, MailNickname, Description, Visibility, Owners (';'), Members (';'), Channels (';').
  • Visibility Visibility for rows that leave it blank.
  • TeamRetrySeconds How long to keep retrying Team creation while a new group replicates.
  • DryRun Preview the teams, owners, members and channels that would change without changing anything.

Connects to: graph

New-TeamsChannelCreates standard, private or shared channels in a team, singly or from a CSV. Enforces the rules the API only reports as opaque errors: private channels need an owner, and channel owners must already be team members.
  • TeamId required Team to create the channels in (group id or display name).
  • ChannelNames One or more channel names. Required unless -CsvPath is used.
  • MembershipType Standard, Private or Shared. Default: Standard.
  • Description Channel description.
  • OwnerUPN Channel owner (UPN). Required for private and shared channels.
  • MemberUPNs Additional members for private and shared channels (UPNs).
  • CsvPath CSV of channels to create. Headers: Name, Description, MembershipType, Owner, Members (';'-separated).
  • DryRun Preview the channels that would be created without changing anything.

Connects to: graph

Remove-TeamMemberreversibleRemoves users from teams, or demotes owners to members with -DemoteToMember. Reverse of Add-TeamMember; refuses to remove a team's last owner unless forced, and warns when a team is left ownerless.
  • TeamIds required One or more teams (group id or display name).
  • UserUPNs required One or more users (UPN or object id).
  • DemoteToMember Drop the owner role but keep the user as a member.
  • Force Allow removing or demoting a team's last owner.
  • DryRun Preview the removals without changing anything.

Connects to: graph

Undo: @{script=Add-TeamMember; parameter_map=; confirm=Add {UserUPNs} back to team {TeamIds} as a member?}

Send-TeamsChannelMessagePosts an Adaptive Card message to one or more Teams channels through Teams Workflows webhooks (template 'Post to a channel when a webhook request is received'). Graph does not let apps post channel messages, so no Graph permission is used; each channel needs its own workflow URL.
  • WebhookUrls required Teams Workflows webhook URL(s), one per channel. Create one from the channel: ... > Workflows > 'Post to a channel when a webhook request is received', then copy the URL.
  • Title Optional heading shown in bold above the message.
  • MessageBody required Message text. Adaptive Card Markdown: **bold**, _italic_, [links](https://...), '- ' bullets.
  • Importance Normal, High (amber heading) or Urgent (red heading and URGENT banner). Default Normal.
  • DryRun Show the card that would be sent without posting it.

Runs on the PowerScripts server; no connection needed.

Send-TeamsMessageSends an Adaptive Card message to a person (Workflows bot direct message) or a group chat through Teams Workflows webhooks, the same way PowerScripts sends its own notifications. Graph chat sending needs a Microsoft protected-API approval, so no Graph permission is used; each chat or person needs a workflow URL.
  • WebhookUrls required Teams Workflows webhook URL(s), one per chat or person. Group chat: ... > Workflows > 'Send webhook alerts to a chat'. One person: a flow 'When a Teams webhook request is received' + 'Post card in a chat or channel' (Flow bot, Chat with Flow bot).
  • Title Optional heading shown in bold above the message.
  • MessageBody required Message text. Adaptive Card Markdown: **bold**, _italic_, [links](https://...), '- ' bullets.
  • Importance Normal, High (amber heading) or Urgent (red heading and URGENT banner). Default Normal.
  • DryRun Show the card that would be sent without sending it.

Runs on the PowerScripts server; no connection needed.

Send-TeamsUrgentMessageBroadcasts an urgent alert card (red attention banner, optional 'Attention:' line and action button) to Teams channels or chats through Teams Workflows webhooks. Graph does not let apps post messages, so no Graph permission is used; Teams' repeat-notification 'urgent' priority is not available to workflow cards.
  • WebhookUrls required Teams Workflows webhook URL(s). Channel: ... > Workflows > 'Post to a channel when a webhook request is received'. Group chat: ... > Workflows > 'Send webhook alerts to a chat'.
  • Subject required Alert subject, shown large and in red.
  • MessageBody required Alert text. Adaptive Card Markdown: **bold**, _italic_, [links](https://...), '- ' bullets.
  • MentionText Who must act, shown as an 'Attention:' line (text only; it does not send an @mention notification).
  • ActionUrl Optional link for an action button, such as a status page or incident ticket.
  • ActionTitle Label for the action button. Default 'Open details'.
  • DryRun Show the card that would be sent without sending it.

Runs on the PowerScripts server; no connection needed.

Set-TeamSettingsAllows or blocks email from outside the organisation to a team's group, or applies a sensitivity label to the team, through Exchange Online (Set-UnifiedGroup) because Graph only allows these changes for signed-in users. Prints the previous value so it can be restored.
  • TeamId required Target team group id (GUID).
  • Action UpdateSettings (external senders) or ApplySensitivityLabel. Default UpdateSettings.
  • ExternalSenders Allow or Block email from outside the organisation (UpdateSettings). Default Block.
  • SensitivityLabelId Sensitivity label GUID when Action=ApplySensitivityLabel (label must be scoped to groups & sites).
  • DryRun Show the current value and the change without making it.

Connects to: exchange-online

SharePoint Online 16

Add-SPSiteAdminGrants site collection administrator rights across named sites or the whole tenant, optionally including OneDrive sites, with a URL filter. Skips locked sites and leaves existing administrators in place.
  • SiteUrls required One or more site URLs, or the literal value 'All'.
  • AdminUPNs required One or more users to make site collection administrators (UPN).
  • IncludeOneDrive Include OneDrive personal sites when 'All' is used.
  • UrlFilter Only act on sites whose URL contains this text. Useful with 'All'.
  • DryRun Preview the grants without changing anything.

Connects to: sharepoint-online

Copy-SPSiteCopies the lists and document libraries of one SharePoint site to another existing site (columns, views, content types via Copy-PnPList) and, with IncludeContent, the files and folders in each library. Does not copy list items, pages, navigation, permissions or flows.
  • SourceSiteUrl required Site to copy from.
  • TargetSiteUrl required Existing site to copy into.
  • Lists List or library titles to copy. Empty = every non-system list and library.
  • IncludeContent Also copy the files and folders in each document library.
  • Overwrite Replace files that already exist on the target.
  • DryRun List what would be copied without changing anything.

Connects to: sharepoint-online

Get-SPActivityReportReports SharePoint site usage or per-user site activity via the Microsoft Graph reports API. (Get-PnPSiteActivityReport does not exist.)
  • SiteUrl Optional site URL filter (SiteUsage report only). Default: emit all sites.
  • Period D7, D30, D90, or D180. Default: D30.
  • ReportType SiteUsage or UserActivity. Default: SiteUsage.
  • OutputFormat CSV or Grid. Default: CSV.

Connects to: graph

Get-SPOrphanedSitesReports SharePoint sites with no owner, an owner whose account no longer exists, or no content change inside the dormancy window - with storage, template and lock state, worst and largest first. Read-only.
  • DormantDays Days without a content change before a site counts as dormant. Default: 180.
  • IncludeOneDrive Include OneDrive personal sites.
  • UrlFilter Only act on sites whose URL contains this text.
  • RiskyOnly Only report sites carrying a flag - no owner, missing owner, or dormant.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: OrphanedSites.csv.

Connects to: sharepoint-online

Get-SPStorageReportAggregates OneDrive and/or SharePoint storage usage and quotas into a CSV/JSON report.
  • ReportScope OneDrive, SharePoint, or All. Default All.
  • OutputFormat CSV or JSON. Default CSV.

Connects to: sharepoint-online

Grant-SPOneDriveAccessResolves a leaver's OneDrive URL from their user profile and grants a delegate site collection administrator access to it, reporting size and last-modified date. Can request provisioning for users who never opened OneDrive.
  • LeaverUPNs required One or more leavers whose OneDrive is being handed over (UPN).
  • DelegateUPN required User who should get access to the OneDrive (UPN).
  • Provision Request provisioning if the leaver has no OneDrive yet. Takes a few minutes; re-run afterwards.
  • DryRun Preview the handover without changing anything.

Connects to: sharepoint-online

Manage-OneDriveQuotaProvisions OneDrive personal sites and/or sets storage quotas for one or more users (or all).
  • UserFilters required One or more UPNs, or the literal value 'All'.
  • QuotaGB Quota in GB. Default 1024.
  • ProvisionOnly Only provision personal site; skip quota update.

Connects to: sharepoint-online

Manage-SPExternalSharingAudits, disables, or enables external sharing across one or more SharePoint sites (or all).
  • SiteFilters required One or more site URLs, or the literal value 'All'.
  • Action Audit, DisableExternal, or EnableExternal. Default Audit.

Connects to: sharepoint-online

Manage-SPHubSiteRegisters a hub site, or associates/unassociates one or more child sites to a hub.
  • HubSiteUrl required Hub site URL.
  • Action RegisterHub, AssociateSite, or Unassociate. Default AssociateSite.
  • ChildSiteUrls One or more child site URLs when associating/unassociating.

Connects to: sharepoint-online

Manage-SPPermissionsGrant Read / Edit / Full Control, or revoke access, on a SharePoint list or document library.
  • SiteUrl required Site containing the list/library. Example: https://contoso.sharepoint.com/sites/finance
  • Principal User or group receiving the permission. Required for any Grant action. Example: jane@contoso.com
  • Action GrantRead / GrantEdit / GrantFull assign the named permission level. Revoke removes all permissions for the principal.
  • LibraryName Document library or list name. Leave blank to apply at site level instead of a specific list.

Connects to: sharepoint-online

Manage-SPSiteLifecycleArchives (read-only), locks, unlocks, or deletes one or more SharePoint sites (or all).
  • SiteFilters required One or more site URLs, or the literal value 'All'.
  • Action Archive, Lock, Unlock, or Delete. Default Archive.
  • DryRun Preview without executing.

Connects to: sharepoint-online

New-BulkSPSitesBulk-creates Team or Communication SharePoint sites from a CSV.
  • CsvPath required CSV with SiteType, Title, Url, OwnerUPN, Description.
  • DryRun Preview without creating.

Connects to: sharepoint-online

Restore-SPDeletedSiteLists the tenant recycle bin with days remaining on each deleted site's 93-day window, flags those about to expire, and restores named sites. Reports the URL-in-use and deleted-group cases the service only returns as opaque errors.
  • SiteUrls Site URLs to restore. Omit with -ListOnly to see what is recoverable.
  • ListOnly Report the deleted sites and change nothing.
  • UrlFilter Only include deleted sites whose URL contains this text.
  • ExpiringWithinDays Only report sites with this many days or fewer left before permanent deletion.
  • DryRun Preview the restores without performing them.

Connects to: sharepoint-online

Set-SPLabelsApplies sensitivity and/or retention labels to one or more SharePoint sites.
  • SiteUrls required One or more target site URLs.
  • SensitivityLabelId Sensitivity label GUID.
  • RetentionLabelName Retention label name.

Connects to: sharepoint-online

Set-SPSiteStorageQuotaSets storage quota and warning level across named sites or the whole tenant, in gigabytes. Refuses a quota below a site's current usage - which would make it read-only immediately - unless forced, and skips sites already at the requested values.
  • SiteUrls required One or more site URLs, or the literal value 'All'.
  • QuotaGB required Storage quota in GB.
  • WarningGB Warning level in GB. Default: 90% of the quota.
  • IncludeOneDrive Include OneDrive personal sites when 'All' is used.
  • UrlFilter Only act on sites whose URL contains this text. Useful with 'All'.
  • Force Allow a quota below the site's current usage, which puts the site into read-only at once.
  • DryRun Preview the quota changes without applying them.

Connects to: sharepoint-online

Test-SharePointConnectivityTroubleshoots SharePoint Online (PnP) as the app sees it: PowerShell and PnP versions, the tenant-admin connection, the app's SharePoint API permissions, an optional site connection and user-profile (OneDrive) read. Tells a missing PnP cmdlet (renamed or removed - the script needs updating) apart from a permissions problem. Read-only.
  • SiteUrl Optional site to connect to and read, e.g. https://contoso.sharepoint.com/sites/HR. Right-click a site in M365 search to fill it in.
  • UserUPN Optional user whose SharePoint profile to read; reports their OneDrive URL.
  • CheckCmdlets Extra PnP cmdlets to test for, e.g. the ones a failing script calls. A missing PnP cmdlet means it does not exist in the installed PnP version.

Runs on the PowerScripts server; no connection needed.

Defender 9

Get-DefenderSecurityReportSecurity posture at a glance: Secure Score with its 30-day change, open Defender alerts by severity and source, open incidents by severity with the most urgent listed, and an optional CSV of every open incident and alert. Read-only.
  • Top How many open incidents to list. Default: 10.
  • CsvPath Also write every open incident and alert to this CSV file.

Connects to: graph

Get-SecureScoreReportMicrosoft Secure Score in plain words: current score, 30- and 90-day change, comparison with similar organisations, progress by area, and the recommendations worth the most points with effort and user impact. Optional HTML report with a trend chart and how-to steps. Read-only.
  • Top How many recommendations to list. Default: 10.
  • ReportPath HTML report with the score, trend chart, areas and how-to steps.

Connects to: graph

Get-SecurityAlertNotificationRetrieves Defender alerts by severity and simulates webhook notification dispatch for each.
  • SeverityFilter required Alert severity to filter on (e.g. high, medium, low).
  • WebhookUrl Webhook endpoint to post alert notifications.

Connects to: graph

Invoke-AdvancedHuntingQueryExecutes a KQL Advanced Hunting query via the Graph Security API and exports the results.
  • KqlQuery required KQL query string to execute against Advanced Hunting.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: graph

Invoke-DeviceRemediationSends an Intune remote action to managed devices found by name or primary user: sync, Defender quick/full scan, signature update, reboot, lock, retire or wipe. Retire and Wipe need -ConfirmDestructive. Network isolation is a Defender portal action and is not offered.
  • DeviceNames Intune device names to act on.
  • UserUPNs Act on every Intune device whose primary user is one of these.
  • Action Sync, QuickScan, FullScan, UpdateSignatures, Reboot, Lock, Retire or Wipe. Default: Sync.
  • KeepEnrollmentData Wipe only: keep the device enrolled in Intune.
  • KeepUserData Wipe only: keep user data on the device.
  • ConfirmDestructive Required for Retire and Wipe, which remove data and cannot be undone.
  • DryRun List the matching devices without sending anything.

Connects to: graph

Manage-DefenderO365PolicyCreates Safe Links or Safe Attachment policies for Defender for Office 365.
  • PolicyType required CreateSafeLinks, CreateSafeAttachment, or UpdateAntiPhish.
  • PolicyName Display name for the new policy.

Connects to: exchange-online

Manage-SecurityIncidentShows, assigns, re-statuses, resolves (with classification and determination) or comments on one or more Microsoft Defender XDR incidents. Device isolation and file quarantine stay in the Defender portal; Show lists the devices involved.
  • IncidentIds required One or more Defender incident ids.
  • Action Show, Assign, SetStatus, Resolve or Comment. Default: Show.
  • AssignTo Assign: the new owner's UPN.
  • Status SetStatus: Active (reopen) or InProgress. Default: InProgress.
  • Classification Resolve: TruePositive, FalsePositive, InformationalExpectedActivity or Unknown. Default: Unknown.
  • Determination Resolve: what was found (optional).
  • Comment Comment to add to each incident (with any action).
  • DryRun Preview without changing anything.

Connects to: graph

Manage-ThreatDetectionRuleLists, shows, creates (from a KQL query, schedule and severity), enables, disables or deletes Microsoft Defender XDR custom detection rules through the Graph custom detection API (preview).
  • Action List, Show, Create, Enable, Disable or Delete. Default: List.
  • RuleIds Rule ids for Show, Enable, Disable or Delete (see List).
  • RuleName Create: display name of the new rule, also used as the alert title.
  • KqlQuery Create: the advanced hunting query. Must return Timestamp, ReportId and the entity column(s).
  • Frequency Create: Every1Hour, Every3Hours, Every12Hours or Every24Hours. Default: Every24Hours.
  • Severity Create: Informational, Low, Medium or High. Default: Medium.
  • Description Create: what the rule looks for.
  • RecommendedActions Create: what an analyst should do when it fires.
  • DeviceIdColumn Create: query column holding the device id, for example DeviceId.
  • UserUpnColumn Create: query column holding a user's UPN, for example AccountUpn.
  • MailboxColumn Create: query column holding a mailbox address, for example RecipientEmailAddress.
  • CreateDisabled Create: leave the new rule turned off.
  • DryRun Preview without changing anything.

Connects to: graph

Manage-ThreatIntelligenceLooks up Microsoft threat intelligence: reputation verdict and reasons for domains and IP addresses, the latest threat articles, and threat actor profiles. Read-only; indicator block lists are managed in the Defender portal.
  • Action Lookup, Articles or IntelProfiles. Default: Lookup.
  • Indicators Lookup: domains, host names or IP addresses to check.
  • Search Articles / IntelProfiles: one search word, for example a malware or actor name.
  • Top Articles / IntelProfiles: how many to list. Default: 10.

Connects to: graph

Copilot 7

Export-CopilotAdoptionDashboardScheduled Copilot adoption dashboard — per-user detail + period summary.
  • Frequency Weekly (D7) or Monthly (D30). Default: Weekly.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: graph

Get-CopilotAdoptionReportPer-user Microsoft 365 Copilot adoption (last activity per app, across the period).
  • Period D7, D30, D90, or D180. Default: D30.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: graph

Get-CopilotInteractionAuditAudits Microsoft 365 Copilot use from the Unified Audit Log (CopilotInteraction records): interactions per user and per app, and the files and sites Copilot read, with sensitivity labels. Prompt text is not audited. Read-only.
  • DaysBack Days to look back, 1-180. Default: 30.
  • UserIds Only these users (UPNs). Empty = everyone.
  • IncludeDetail Also list every interaction, not just the summaries.
  • OutputFormat Table, CSV or JSON. Default: Table.

Connects to: exchange-online

Get-CopilotUsageMetricsMicrosoft 365 Copilot usage metrics — per-user detail plus enabled/active counts for the period.
  • Period D7, D30, D90, or D180. Default: D30.
  • OutputFormat CSV or JSON. Default: CSV.

Connects to: graph

Get-CopilotUserActivityPer-user Copilot activity (last activity per app) for one or more UPNs, or all users.
  • UserFilters required One or more UPNs to query, or the literal value 'All'.
  • Period D7, D30, D90, or D180. Default: D30.

Connects to: graph

Optimize-CopilotLicensesIdentifies and (with -CopilotSkuId) removes Copilot licenses from inactive users via the Graph beta usage report.
  • InactiveDays Inactivity threshold in days. Default: 60.
  • CopilotSkuId Tenant Copilot SKU GUID. Required when -DryRun is not set. Find via Get-MgSubscribedSku.
  • Period Lookback period: D30, D90, or D180. Default: D90.
  • DryRun Preview removals without executing.

Connects to: graph

Set-BulkCopilotLicenseAssigns or removes the Microsoft 365 Copilot license for a list of users (picked or from a CSV). Finds the tenant's Copilot SKU automatically, shows free units, and refuses to start an assignment there are not enough licenses for.
  • UserUPNs Users to license or unlicense. Use this, CsvPath, or both.
  • CsvPath Path on the PowerScripts server to a CSV file with a UPN column.
  • Action Assign or Remove. Default: Assign.
  • SkuPartNumber Exact SKU part number, only needed when the tenant has more than one Copilot SKU. Default: found automatically.
  • DryRun Preview changes without executing.

Connects to: graph

On-premises · 62

Network & infrastructure 33

Get-CertificateExpirationConnects to one or more HTTPS endpoints with phase-by-phase diagnostics (DNS / TCP / TLS / cert) and per-IP candidate walk that prefers IPv4 to avoid dual-stack IPv6-first stalls; reads the X.509 certificate and reports expiration against warning and critical thresholds. Per-URL ports (https://host:8443) are honoured, results are sorted soonest-expiry first with unreachable endpoints on top, and a rollup of everything expiring or unreachable is written to the warning stream. Status values include OK, WARN, CRITICAL, EXPIRED, DNS-FAIL, TCP-TIMEOUT, TCP-REFUSED, TCP-RESET, TLS-FAIL, ERROR.
  • Url required One or more hostnames or URLs to query. A port in the URL (https://host:8443) overrides -Port for that endpoint.
  • Port TCP port for endpoints that do not specify one. Default 443.
  • WarnDays Days-until-expiry threshold that triggers WARN. Default 30.
  • CriticalDays Days-until-expiry threshold that triggers CRITICAL. Default 7.
  • TimeoutMs TCP connect timeout per candidate IP in milliseconds. Default 10000.
  • DnsTimeoutMs DNS resolution timeout in milliseconds. Default 3000.
  • RetryCount Retry count on transient TCP-TIMEOUT or TCP-RESET (per candidate IP). Default 0.
  • RetryDelayMs Delay between retries in milliseconds. Default 500.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • OutputFormat Summary (readable lines, the default), or Object, CSV, JSON, Grid for other tools.
  • IgnoreValidation Skip server certificate validation (inspect-only mode).
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Get-ExchangePatchInventoryReads each on-premises Exchange server's exact build from ExSetup.exe (cumulative update plus security update) over WinRM and reports it to PowerScripts CVE Watch, which matches it against Microsoft's security update guide and CISA's Known Exploited Vulnerabilities list. Finds the servers with Get-ExchangeServer when none are named. Schedule it nightly. Remote servers need WinRM and a local admin account (Credential).
  • ComputerName Exchange servers. Default: every server Get-ExchangeServer lists, else this server.
  • Credential Credential for WinRM to the servers.
  • DryRun Preview without connecting.

Runs on the PowerScripts server; no connection needed.

Get-IISApplicationPoolStatusReports IIS application pool and site state via the WebAdministration module when available, falling back to appcmd.exe XML output (locally or remotely via Invoke-Command); enriches each pool with worker process PIDs, .NET runtime version, identity, idle timeout, and recent WAS recycle event counts (event IDs 5074/5075/5076/5077/5079/5080/5117).
  • ComputerName Target computer. Default localhost.
  • PoolNameFilter Wildcard filter for app pool names. Default '*'.
  • SiteNameFilter Wildcard filter for site names. Default '*'.
  • RecycleWindowHours Recycle event lookback in hours. Default 24.
  • StrictRunningOnly Treat any non-Running pool as FAIL.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: Local: WebAdministration module or appcmd.exe, Remote: WinRM + IIS installed

Get-ServiceBannerConnects to TCP services on configured ports and grabs protocol-aware banners (HTTP HEAD, HTTPS via SslStream, SSH version exchange, SMTP EHLO, FTP/POP3/IMAP first frame, Telnet read), then extracts product and version strings via regex patterns.
  • Target required FQDN or IP host(s).
  • Port required TCP port(s) to probe.
  • ConnectTimeoutMs TCP connect timeout in ms. Default 3000.
  • DnsTimeoutMs DNS resolution timeout in ms. Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • ReadTimeoutMs Banner read timeout in ms. Default 3000.
  • Protocol Auto, Http, Https, Ssh, Smtp, Ftp, Pop3, Imap, Telnet, Generic. Default Auto (port-based).
  • MaxBytes Maximum bytes to read. Default 4096.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Get-WindowsPatchInventoryReads each Windows server's exact build (with update revision), installed updates and roles over WinRM and reports them to PowerScripts CVE Watch, which matches them against Microsoft's security update guide and CISA's Known Exploited Vulnerabilities list. Name the servers, or set FromAD to find every enabled Windows Server computer account in Active Directory (optionally one OU), skipping accounts that have not signed in for ActiveDays days, so new servers are covered without editing the list. Schedule it nightly. Remote servers need WinRM and an admin account (Credential); this server needs nothing.
  • ComputerName Servers to inventory. Default this server, or none when FromAD is set.
  • FromAD Also inventory every enabled Windows Server computer account in Active Directory.
  • SearchBase With FromAD: only computers in this OU, e.g. OU=Servers,DC=contoso,DC=com.
  • ActiveDays With FromAD: skip computers that have not signed in to the domain for this many days. Default 30; 0 keeps all.
  • IncludeWorkstations With FromAD: include Windows 10 and 11 workstations as well as servers.
  • Credential Credential for WinRM to remote servers.
  • DryRun Show which servers would be read without connecting.

Runs on the PowerScripts server; no connection needed.

Install-WindowsSecurityUpdateInstalls security updates by KB number on Windows servers through the Windows Update agent (run as a one-off SYSTEM task, since the agent refuses installs over a remote session). When Microsoft has replaced the KB with a newer cumulative update it installs that instead, unless ExactKbOnly is set. Restarts only with Reboot, and reports the new build to PowerScripts CVE Watch so the finding and its ticket close. The Fix button on a CVE opens this with the servers and KB filled in. Remote servers need WinRM and a local admin account (Credential); every server needs Windows Update or WSUS.
  • ComputerName required Servers to update.
  • KB required KB numbers to install, e.g. KB5126655.
  • Credential Credential for WinRM to remote servers.
  • Reboot Restart a server when the update needs it. This server restarts two minutes after the run ends.
  • ExactKbOnly Install only the named KBs, never the newer cumulative update that replaces them.
  • DryRun Show what would be installed without installing.

Runs on the PowerScripts server; no connection needed.

Invoke-NetworkDiscoveryDiscovers live hosts on a CIDR subnet or IP range using parallel ICMP echo, TCP probes against common service ports, and ARP cache walking; enriches results with MAC addresses and vendor (OUI) lookup, optional reverse DNS, and TTL hints for OS fingerprinting.
  • Target required CIDR (10.0.0.0/24) or range (10.0.0.1-10.0.0.50).
  • Method Probe methods: Icmp, Tcp, Arp. Default all.
  • TcpPorts TCP ports to probe. Default 22,80,135,443,445,3389.
  • TimeoutMs Probe timeout in ms. Default 800.
  • Concurrent Peak concurrent workers. Default 64.
  • ResolveNames Reverse-DNS each live host.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Invoke-SubnetPortScanTCP-connect port scan across CIDR subnets, IP ranges, or comma-separated targets, driven by a .NET RunspacePool for concurrency, with per-connection timeout, optional protocol-aware service banner grabbing, and CSV/JSON export.
  • Target required CIDR (10.0.0.0/24), range (10.0.0.1-10.0.0.50), or hostname/IP list.
  • Port required Port list/range (e.g., '22,80,443' or '1-1024').
  • Concurrent Peak concurrent workers. Default 100.
  • TimeoutMs Per-connection timeout in ms. Default 1000.
  • GrabBanner Read service banner from open ports.
  • BannerTimeoutMs Banner read timeout in ms. Default 1500.
  • OnlyOpen Suppress closed ports in output.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Measure-ApiLoadProfileDrives concurrent or ramp-based load against REST or GraphQL endpoints using a .NET RunspacePool, reporting throughput (req/sec), error rate, min/avg/max latency, and configurable percentile breakpoints (P50/P75/P95/P99).
  • Url required Target URL.
  • Engine REST or GraphQL. Default REST.
  • Method HTTP method. Default GET.
  • Body Request body or file path (REST).
  • GraphQlQuery GraphQL query/mutation document (GraphQL engine).
  • GraphQlVariables GraphQL variable values.
  • Headers Additional request headers.
  • AuthScheme None, Bearer, or Basic. Default None.
  • BearerToken Token for Bearer auth.
  • BasicUsername Username for Basic auth.
  • BasicPassword Password for Basic auth.
  • Concurrent Peak concurrent workers. Default 10.
  • TotalRequests Total requests to issue. 0 = run for DurationSec. Default 100.
  • DurationSec Test duration when TotalRequests=0. Default 30.
  • RampUpSec Seconds to ramp to full concurrency. 0 = immediate. Default 0.
  • Percentiles Latency percentiles to compute. Default 50,75,95,99.
  • ErrorThresholdPercent Error-rate percent above which run is FAIL. Default 5.
  • TimeoutSec Per-request timeout in seconds. Default 15.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Measure-NetworkThroughputDrives sustained TCP or UDP traffic to a remote endpoint over a fixed duration and reports Mbps, total data transferred, error count, and optional concurrent ICMP latency correlation.
  • Target required Remote host to test against.
  • Port required Remote TCP/UDP port.
  • Protocol TCP or UDP. Default TCP.
  • DurationSec Test duration in seconds. Default 10.
  • BufferBytes Send buffer / datagram size in bytes. Default 65536.
  • Direction Upload (client sends) or Download (client reads). Default Upload.
  • LatencyCorrelation Run concurrent ICMP pings to correlate throughput with latency.
  • OutputFormat Object, CSV, or JSON. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Monitor-CloudServiceHealthQueries public health endpoints for AWS (per-service RSS feeds), Azure (Atom status feed), and GCP (incidents JSON API), reports availability and active incidents, and trends degradation within a configurable time window.
  • Provider AWS, Azure, GCP, or All. Default All.
  • AwsRegions AWS region filter (e.g. us-east-1). Omit for all curated services.
  • AzureRegions Azure region name filter. Omit for global feed.
  • OnlyDegraded Suppress OK rows; show only degraded or errored services.
  • TrendHours Age window (hours) for incident trending. Default 72.
  • TimeoutSec Per-provider HTTP timeout in seconds. Default 20.
  • OutputFormat Object, JSON, Grid, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Monitor-NtpSynchronizationSends raw NTP (UDP/123) requests to one or more time servers, calculates clock offset, round-trip delay, and jitter from multiple samples, and warns on stratum, offset, or inter-server spread violations.
  • Server NTP server(s) to query. Default: time.windows.com, pool.ntp.org, time.google.com, time.cloudflare.com.
  • SamplesPerServer Number of NTP packets per server for jitter calculation. Default 4.
  • SampleIntervalMs Delay between samples in ms. Default 500.
  • OffsetWarnMs Absolute offset (ms) that triggers WARN. Default 128.
  • JitterWarnMs Jitter (ms) that triggers WARN. Default 50.
  • MaxStratum Maximum acceptable stratum level. Default 3.
  • TimeoutMs UDP receive timeout per packet in ms. Default 3000.
  • OutputFormat Object, CSV, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Monitor-WindowsServerHealthCollects Windows server health via CIM/WMI sessions (WSMan or DCOM) — CPU LoadPercentage, OS memory, fixed-disk free space, non-disabled services in non-Running state, recent error events from System and Application logs — and applies WARN/FAIL thresholds with configurable required-service validation.
  • ComputerName Target computers. Default localhost.
  • Credential Credential for remote CIM session.
  • UseDcom Use DCOM instead of WSMan.
  • CpuWarnPct CPU percent — WARN threshold. Default 75.
  • CpuFailPct CPU percent — FAIL threshold. Default 90.
  • MemWarnPct Memory percent used — WARN threshold. Default 80.
  • MemFailPct Memory percent used — FAIL threshold. Default 92.
  • DiskWarnFreePct Free-disk percent — WARN below. Default 15.
  • DiskFailFreePct Free-disk percent — FAIL below. Default 5.
  • RequiredServices Service names that must be Running.
  • EventWindowHours Recent error event window in hours. Default 24.
  • EventTopN Maximum recent error events per log. Default 10.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: WinRM (WSMan) or DCOM to target, Local admin or equivalent

New-MonitoringReportAggregates JSON or CSV output produced by any monitoring script in this catalog into a self-contained HTML report — status rollup cards, per-group sortable tables (click headers), inline SVG sparklines for trended numeric metrics (LatencyMs, CpuPercent, etc.), color-coded status pills, and an optional raw-JSON dump. No external CSS or JS dependencies.
  • InputPath required Input JSON/CSV files from any monitoring script.
  • OutputPath required Output HTML report path.
  • Title Report title. Default 'PS365 Monitoring Report'.
  • GroupBy Property used for per-group tables. Default 'Status'.
  • TrendProperty Numeric properties candidates for sparkline. First with >=2 values wins per group.
  • TopN Top-N rows per group. Default 200.
  • EmbedRawJson Append raw JSON dump of all rows in a collapsible section.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Send-TestNotificationMulti-channel alert delivery validator. Sends a structured test notification across any combination of Syslog (UDP RFC5424 framing with computed PRI), SNMP trap (snmptrap.exe shell-out, v2c, custom enterprise OIDs), Microsoft Teams MessageCard, Slack incoming webhook, PagerDuty Events v2, and SMTP — captures per-channel delivery success and round-trip latency.
  • Channel Channels: Syslog, SnmpTrap, Teams, Slack, PagerDuty, Smtp. Default = auto-detect from supplied params.
  • Subject Notification subject. Default 'PS365 Test Notification'.
  • Body Notification body.
  • Severity DEBUG/INFO/WARN/ERROR/CRIT. Default INFO.
  • SyslogServer Syslog server hostname/IP.
  • SyslogPort Syslog UDP port. Default 514.
  • SyslogFacility Syslog facility 0-23. Default 1 (user).
  • SnmpTarget SNMP target host[:port] (default port 162).
  • SnmpCommunity SNMP community. Default 'public'.
  • SnmpTrapOid SNMP trap OID.
  • TeamsWebhookUrl Microsoft Teams incoming webhook URL.
  • SlackWebhookUrl Slack incoming webhook URL.
  • PagerDutyRoutingKey PagerDuty Events v2 routing key.
  • SmtpServer SMTP server.
  • SmtpPort SMTP port. Default 587.
  • SmtpFrom SMTP from address.
  • SmtpTo SMTP recipient(s).
  • SmtpCredential SMTP credential.
  • SmtpUseSsl Enable STARTTLS.
  • TimeoutSec Per-channel timeout. Default 10.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: Per-channel: UDP/514 to syslog; UDP/162 to NMS; HTTPS to webhook providers; SMTP server access

Test-CertificateChainPerforms full TLS certificate chain validation using X509Chain — walks intermediates, checks NotAfter on each cert, runs online OCSP/CRL revocation checks with configurable scope (leaf only / entire chain / exclude root), and flags chain breaks, untrusted anchors, and expiring intermediates.
  • Target required Hostname, URL, or IP to inspect.
  • Port TLS port. Default 443.
  • ServerName SNI hostname (defaults to Target).
  • RevocationMode NoCheck, Online, or Offline. Default Online.
  • RevocationFlag EndCertificateOnly, EntireChain, or ExcludeRoot. Default ExcludeRoot.
  • WarnDays Days-until-expiry threshold for WARN status. Default 30.
  • TimeoutMs TCP connect timeout in ms. Default 10000.
  • DnsTimeoutMs DNS resolution timeout in ms. Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-CertificateTransparencyQueries the public crt.sh JSON API for certificate-transparency log entries matching a domain or wildcard pattern, filters to a configurable lookback window, dedupes by serial, aggregates by issuer, diffs against a regex allow-list of trusted CAs to flag unexpected issuers, and warns on issuance-rate spikes.
  • Domain required Domain or wildcard pattern (e.g., 'example.com' or '%.example.com').
  • Limit Maximum cert records to return. Default 200.
  • WindowDays Lookback window in days. Default 30.
  • AllowedIssuer Regex patterns matching trusted issuer CNs; anything else triggers FAIL.
  • IncludeSubdomains Add wildcard prefix to query.
  • SpikeThreshold Issuance count above which to WARN. Default 50.
  • TimeoutSec Request timeout in seconds. Default 30.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: HTTPS to crt.sh

Test-DatabaseConnectivityTests connection and query latency to SQL Server (native ADO.NET), PostgreSQL (Npgsql or TCP fallback), MySQL (MySql.Data or TCP fallback), and Redis (raw RESP protocol). Reports connect time, query latency, and engine version.
  • Engine required SqlServer, PostgreSQL, MySQL, or Redis.
  • Server required Database server hostname or IP.
  • Port Port. Defaults: SqlServer=1433, PostgreSQL=5432, MySQL=3306, Redis=6379.
  • Database Database name (not applicable to Redis).
  • Username Authentication username. Omit for Windows auth on SqlServer.
  • Password Authentication password.
  • Query Custom diagnostic query. Defaults to engine-specific version query or PING.
  • LatencyWarnMs Query latency (ms) that flags WARN. Default 250.
  • TimeoutSec Connect and query timeout in seconds. Default 10.
  • DnsTimeoutMs DNS resolution timeout in ms (TCP-fallback paths). Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-DnsResolutionResolves hostnames against one or more DNS servers, captures latency and answers, and flags drift between resolvers.
  • Name required One or more hostnames to resolve.
  • Server DNS servers to query. Omit to use the system resolver.
  • RecordType A, AAAA, CNAME, MX, TXT, NS, SOA, SRV, PTR, or ANY. Default A.
  • LatencyWarnMs Latency threshold (ms) that triggers WARN. Default 200.
  • OutputFormat Object, CSV, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-DnssecValidationValidates the DNSSEC chain-of-trust for a domain by walking parent labels, fetching DNSKEY, DS, and RRSIG records via a DNSSEC-aware resolver (e.g. 1.1.1.1), checking the resolver's Authenticated Data flag on the leaf answer, and flagging unsigned zones, broken delegations, missing signatures, and AD-flag failures.
  • Domain required Domain to validate (e.g., cloudflare.com).
  • RecordType Leaf record type to fetch. Default A.
  • DnsServer Validating DNS server. Default 1.1.1.1.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: UDP/TCP 53 to specified DNS server (DNSSEC-aware)

Test-EgressPortMatrixValidates outbound firewall posture by running concurrent TCP-connect tests across a curated target set (or supplied list) against a configurable port matrix (22, 53, 80, 123, 443, 465, 587, 993, 995, 3389, 8080, 8443 by default), produces a target × port permitted/blocked grid, and FAILs the run when configured required ports are blocked anywhere.
  • Target Targets to probe. Default curated public hosts.
  • Port Ports to probe each target. Default common service ports.
  • TimeoutMs Per-connection timeout in ms. Default 1500.
  • DnsTimeoutMs DNS resolution timeout in ms. Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • Concurrent Peak concurrent workers. Default 32.
  • RequiredPorts Ports that MUST be open everywhere (else FAIL). Default 443.
  • OutputFormat Object, JSON, CSV, or Matrix. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-EmailSecurityRecordsAudits a domain's email-spoofing posture by resolving SPF, DMARC, and DKIM (selector probe) DNS records, recursively expanding SPF includes with a depth cap, counting DNS lookups against the RFC 7208 limit of 10, scoring DMARC enforcement strength (p=reject vs quarantine vs none), and estimating DKIM RSA key size from the public-key blob.
  • Domain required Domain to audit (e.g., example.com).
  • DkimSelector DKIM selectors to probe. Defaults to common selector list.
  • DnsServer Specific DNS server to query (defaults to OS resolver).
  • SpfMaxDepth Maximum SPF include depth. Default 10.
  • OutputFormat Summary (readable lines, the default), or Object, JSON, CSV for other tools.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-GraphQlEndpointPOSTs GraphQL queries or mutations with variable substitution, optionally runs full schema introspection, detects errors in the GraphQL errors array, matches error messages against regex patterns, and asserts on dot-notation data properties.
  • Url required GraphQL endpoint URL.
  • Query GraphQL query or mutation document string.
  • Variables Variable values serialised into the request variables field.
  • OperationName Named operation to execute in multi-operation documents.
  • IntrospectSchema Run __schema introspection and return type system summary.
  • Headers Additional request headers.
  • AuthScheme None, Bearer, or Basic. Default None.
  • BearerToken Token for Bearer auth.
  • BasicUsername Username for Basic auth.
  • BasicPassword Password for Basic auth.
  • ErrorPatterns Regex patterns to match against GraphQL error messages.
  • AssertData Dot-notation assertions against the data object.
  • LatencyWarnMs Response time (ms) that triggers WARN. Default 1000.
  • TimeoutSec Request timeout in seconds. Default 30.
  • SkipCertCheck Skip TLS certificate validation.
  • OutputFormat Object, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-HttpEndpointProbes HTTP/HTTPS endpoints for status code, response time, final URI, and an optional response-body regex match.
  • Url required One or more URLs to probe.
  • Method GET, HEAD, or POST. Default GET.
  • ExpectedStatus Expected HTTP status code. Default 200.
  • ExpectedContentRegex Regex the response body must match for OK status.
  • LatencyWarnMs Response time (ms) above which result is WARN. Default 1500.
  • TimeoutSec Request timeout in seconds. Default 15.
  • SkipCertCheck Skip TLS validation (use only for testing).
  • OutputFormat Object, CSV, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-HttpSecurityHeadersInspects HTTP response headers for security controls (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP/COEP/CORP), evaluates value quality for HSTS max-age and CSP permissiveness, penalizes information-disclosure headers (Server, X-Powered-By), and assigns a weighted A-F grade.
  • Url required Target URL (HTTPS recommended).
  • Method HTTP method: GET or HEAD. Default GET.
  • UserAgent User-Agent header value.
  • Headers Additional request headers.
  • FollowRedirects Follow up to 5 redirects (off by default).
  • RequireHttps Force FAIL if final URL is not HTTPS.
  • TimeoutSec Request timeout in seconds. Default 15.
  • OutputFormat Summary (readable lines, the default), or Object, JSON, CSV for other tools.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-PortConnectivityTests TCP or UDP port reachability against a destination host with optional polling, latency capture, and CSV/JSON export.
  • Target required Destination host (FQDN or IP).
  • Port required One or more port numbers to probe.
  • Protocol TCP or UDP. Default TCP.
  • TimeoutMs Connection timeout in milliseconds. Default 3000.
  • DnsTimeoutMs DNS resolution timeout in ms (TCP only). Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6 (TCP only). Default Auto.
  • PollCount Number of polling attempts. 0 = single check.
  • PollIntervalSec Seconds between polls. Default 5.
  • OutputFormat Object, CSV, or JSON. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-ProxyTraversalDetects HTTP proxy presence (system proxy via WebRequest.GetSystemWebProxy plus *_PROXY environment variables), measures direct vs proxied request latency to a control URL, captures proxy-injected response headers (Via, X-Forwarded-For), and detects TLS MITM substitution by comparing the served leaf certificate's SHA1 thumbprint against an expected fingerprint.
  • Url required Control URL to probe (HTTPS recommended).
  • ExpectedThumbprint Expected leaf cert SHA1 thumbprint for MITM detection.
  • ProxyUrl Explicit proxy URL (overrides system proxy).
  • ProxyCredential Proxy credential.
  • Iterations Iterations for latency averaging. Default 3.
  • TimeoutSec Request timeout in seconds. Default 15.
  • LatencyOverheadWarnPct Proxied-vs-direct overhead percent that triggers WARN. Default 100.
  • DnsTimeoutMs DNS resolution timeout in ms (TLS thumbprint probe). Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-RestEndpointExecutes configurable HTTP methods (GET/POST/PUT/DELETE/PATCH) with Bearer, Basic, or OAuth2 client-credentials auth, JSON/XML body injection, dot-notation property assertions, lightweight JSON schema validation, and indicative per-phase latency breakdown (DNS/TCP/TLS/TTFB/Total).
  • Url required Target REST URL.
  • Method GET, POST, PUT, DELETE, or PATCH. Default GET.
  • Headers Additional request headers.
  • ContentType Request Content-Type. Default application/json.
  • Body Request body string or path to a body file.
  • AuthScheme None, Bearer, Basic, or OAuth2. Default None.
  • BearerToken Token for Bearer auth.
  • BasicUsername Username for Basic auth.
  • BasicPassword Password for Basic auth.
  • OAuth2TokenUrl OAuth2 token endpoint for client_credentials flow.
  • OAuth2ClientId OAuth2 client ID.
  • OAuth2ClientSecret OAuth2 client secret.
  • OAuth2Scope OAuth2 scope string.
  • ExpectedStatus Acceptable HTTP status codes. Default 200.
  • AssertProperty Dot-notation property assertions against the response JSON.
  • SchemaFile Path to a lightweight JSON schema file (required + properties).
  • LatencyWarnMs Total response time (ms) that triggers WARN. Default 1000.
  • TimeoutSec Request timeout in seconds. Default 30.
  • SkipCertCheck Skip TLS certificate validation.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-SmtpConnectivityConnects to an SMTP server, reads the banner, issues EHLO, parses capabilities, optionally negotiates STARTTLS, and probes for open-relay acceptance.
  • Server required SMTP server hostname or IP.
  • Port SMTP port. Default 25.
  • EhloName Hostname presented in EHLO. Default: local computer name.
  • TestStartTls Attempt STARTTLS upgrade after EHLO.
  • TestRelay Send MAIL FROM / RCPT TO to probe for open-relay (own servers only).
  • RelayFrom Sender address for relay probe. Default probe@example.com.
  • RelayTo Recipient address for relay probe. Default check@example.net.
  • TimeoutMs Connection and read timeout in ms. Default 10000.
  • DnsTimeoutMs DNS resolution timeout in ms. Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • OutputFormat Object, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-TlsConfigurationProbes a TLS endpoint for supported protocol versions (SSLv3 through TLS 1.3) and negotiated cipher suites using SslStream, flags weak protocols and ciphers (RC4, 3DES, NULL, EXPORT, sub-128-bit), and assigns an A-F security grade.
  • Target required Target hostname or IP.
  • Port TLS port. Default 443.
  • Protocols Protocols to probe: Ssl3, Tls, Tls11, Tls12, Tls13. Default all.
  • TimeoutMs TCP connect timeout in ms. Default 10000.
  • DnsTimeoutMs DNS resolution timeout in ms. Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • ServerName SNI hostname. Defaults to Target.
  • OutputFormat Summary (readable lines, the default), or Object, JSON, CSV for other tools.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-TraceroutePathMulti-protocol (ICMP/TCP) traceroute with per-hop min/avg/max latency, blackhole detection, optional PTR resolution, and route-change comparison against a saved baseline.
  • Target required Destination host (FQDN or IP).
  • Protocol ICMP or TCP. Default ICMP.
  • TcpPort TCP destination port for TCP-mode probes. Default 80.
  • MaxHops Maximum TTL / hop limit. Default 30.
  • ProbesPerHop Probes per hop for latency statistics. Default 3.
  • TimeoutMs Per-probe timeout in milliseconds. Default 3000.
  • DnsTimeoutMs DNS resolution timeout in ms (target is resolved once up front). Default 3000.
  • AddressFamily Auto (IPv4 first, fall back to IPv6), IPv4, or IPv6. Default Auto.
  • ResolveNames Perform PTR (reverse DNS) lookups on each hop IP.
  • BaselinePath JSON baseline file to compare hop IPs against for route-change detection.
  • SaveBaseline Write current route to the baseline file.
  • OutputFormat Object, CSV, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Test-WebSocketConnectionOpens a WebSocket (ws/wss) session using .NET ClientWebSocket, measures handshake latency, negotiates subprotocols, exchanges configurable message count with RTT sampling, validates response frames against a regex, and retries with configurable reconnect logic.
  • Uri required WebSocket endpoint URI (ws:// or wss://).
  • SubProtocol Subprotocol(s) to negotiate during handshake.
  • Message Text message to send each exchange. Default 'ping'.
  • MessageCount Number of send/receive cycles. Default 1.
  • ExpectedResponseRegex Regex each response frame must match.
  • KeepAliveIntervalSec TCP keep-alive interval in seconds. Default 0 (disabled).
  • ReconnectAttempts Retry count on failure. Default 0.
  • ReconnectDelaySec Seconds between reconnect attempts. Default 2.
  • Headers Additional HTTP headers for the upgrade request.
  • AuthScheme None, Bearer, or Basic. Default None.
  • BearerToken Token for Bearer auth.
  • BasicUsername Username for Basic auth.
  • BasicPassword Password for Basic auth.
  • HandshakeTimeoutMs WebSocket handshake timeout in ms. Default 10000.
  • MessageTimeoutMs Per-message send/receive timeout in ms. Default 5000.
  • SkipCertCheck Skip TLS certificate validation for wss://.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Watch-PingLatencySends a configurable burst of ICMP echo requests per target and reports min/avg/max round-trip, jitter, and packet loss against thresholds.
  • Target required One or more hostnames or IPs to ping.
  • Count Pings per target. Default 20.
  • IntervalMs Delay between pings in ms. Default 500.
  • LatencyWarnMs Average-latency threshold that flags WARN. Default 100.
  • LossWarnPercent Packet-loss percent that flags WARN. Default 5.
  • TimeoutMs Per-ping timeout in ms. Default 1500.
  • OutputFormat Object, CSV, JSON, or Grid. Default Object.
  • DryRun Preview action without executing.

Runs on the PowerScripts server; no connection needed.

Active Directory 29

Add-ADPrivilegedGroupMemberreversibleAdds one or more users to privileged AD groups only (Domain Admins, Enterprise Admins, Administrators, Operators, adminCount=1). Marked privileged: never auto-granted to a role.
  • GroupNames required One or more target groups (sAMAccountName, DN, or GUID).
  • UserNames required One or more users to add (sAMAccountName, UPN, DN, or GUID).
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the memberships that would be added without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Remove-ADPrivilegedGroupMember; parameter_map=; confirm=Remove {UserNames} from privileged group {GroupNames}?}

Add-ADUserProxyAddressreversibleAdds email aliases to on-premises AD users' proxyAddresses, optionally promoting one to primary. Skips addresses already assigned anywhere in the directory, since proxy addresses must be unique.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • Addresses required Addresses to add. Bare addresses are treated as smtp:.
  • MakePrimary Promote the address to primary, demoting the current primary to an alias. One address only.
  • SetMailAttribute Also write the new primary address to the mail attribute. -MakePrimary only.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the resulting address list without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Remove-ADUserProxyAddress; parameter_map=; confirm=Remove proxy address {Addresses} from {UserNames}?}

Add-ADUserToGroupreversibleAdds one or more users to one or more on-premises Active Directory groups. Idempotent — skips memberships that already exist. Privileged groups (Domain Admins and similar) are refused; they use Add-ADPrivilegedGroupMember.
  • GroupNames required One or more target groups (sAMAccountName, DN, or GUID).
  • UserNames required One or more users to add (sAMAccountName, UPN, DN, or GUID).
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the memberships that would be added without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Remove-ADUserFromGroup; parameter_map=; confirm=Remove {UserNames} from AD group {GroupNames}?}

Copy-ADGroupMembershipCopies one AD user's group memberships onto other users, in additive or mirror mode. Skips privileged and AdminSDHolder-protected groups unless explicitly included, and never touches the primary group.
  • SourceUser required User to copy memberships from (sAMAccountName, UPN, DN, or GUID).
  • TargetUsers required One or more users to copy memberships to.
  • Mode Add (default) keeps the target's own groups; Mirror removes any the source does not have.
  • ExcludeGroups Groups to leave out of the copy (sAMAccountName, DN, or GUID).
  • IncludePrivilegedGroups Include privileged groups, which are skipped by default.
  • Force Required for Mirror, which removes memberships the target already has.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the memberships that would be added or removed without changing anything.

Connects to: AD module (RSAT)

Disable-ADUserAccountreversibleDisables on-premises AD user accounts, stamps the reason and date into the description, and optionally moves them to a holding OU or hides them from the GAL. Refuses built-in and critical system accounts unless forced.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • Reason Why the account is being disabled. Recorded in the description attribute.
  • MoveToOU OU to move the disabled account into, e.g. 'OU=Disabled Users,DC=contoso,DC=com'.
  • HideFromGAL Hide the user from Exchange address lists (needs an Exchange-extended schema).
  • Force Allow built-in and critical system accounts to be disabled.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the accounts that would be disabled without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Enable-ADUserAccount; parameter_map=; confirm=Re-enable {UserNames}, move them back to the OU they were disabled from and clear the disabled stamp?}

Enable-ADUserAccountreversibleEnables on-premises AD user accounts and strips the '[Disabled <date>]' stamp from the description. Reverse of Disable-ADUserAccount; can also unlock, clear an account expiry, and move the object back.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • Unlock Also unlock the account if it is locked out.
  • ClearExpiration Clear the account expiry date, which otherwise still blocks sign-in.
  • MoveToOU OU to move the account back into, e.g. 'OU=Staff,DC=contoso,DC=com'.
  • UnhideFromGAL Unhide the user from the Exchange address lists.
  • KeepDescription Leave the description as it is instead of stripping the disabled stamp.
  • KeepInCurrentOU Do not move the account back to the OU it was disabled from.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the accounts that would be enabled without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Disable-ADUserAccount; parameter_map=; confirm=Disable {UserNames} again?}

Get-ADGroupMembershipLists the members of one or more on-premises Active Directory groups, flagging disabled accounts, last logon, nested groups, and primary-group members.
  • GroupNames required One or more groups (sAMAccountName, DN, or GUID).
  • Recursive Expand nested groups and report every effective member.
  • Server Domain controller to query. Default: any DC.
  • OutputFormat Table, CSV, or JSON. Default: Table.
  • CsvPath File path for CSV output. Default: ADGroupMembership.csv.

Connects to: AD module (RSAT)

Get-ADPrivilegedAccountReportExpands every privileged AD group through nesting and reports each member with its weaknesses - password never expires, kerberoastable SPN, unconstrained delegation, stale or disabled - plus accounts carrying adminCount drift after privilege was removed. Read-only.
  • AdditionalGroups Extra groups to treat as privileged, on top of the built-in list.
  • StaleDays Days without a logon before a privileged account is flagged stale. Default: 90.
  • SkipAdminCountDrift Leave out the adminCount drift section.
  • OutputFormat Summary (plain-words findings per account), Table, CSV, or JSON. Default: Summary.
  • CsvPath File path for CSV output. Default: PrivilegedAccounts.csv.
  • Server Domain controller to target. Default: any DC.

Connects to: AD module (RSAT)

Get-ADStaleAccountsReports AD users and computers with no recent logon, using both lastLogonTimestamp and password age so decommissioned machines and never-used accounts are caught. Read-only; feeds the disable and cleanup scripts.
  • DaysInactive Days since the last logon before an account counts as stale. Default: 90.
  • Scope Users, Computers, or Both. Default: Both.
  • SearchBase Limit the search to one OU. Default: the whole domain.
  • IncludeDisabled Also report accounts that are already disabled.
  • ExcludeNeverLoggedOn Leave out accounts that have never signed in.
  • OutputFormat Summary (one plain line per account), Table, CSV, or JSON. Default: Summary.
  • CsvPath File path for CSV output. Default: StaleAccounts.csv.
  • Server Domain controller to target. Default: any DC.

Connects to: AD module (RSAT)

Install-RSATFeaturesInstalls Remote Server Administration Tools (RSAT) on the runner host so AD/DNS/GroupPolicy PowerShell modules become available to other catalog scripts. Detects Windows client vs Server and uses Add-WindowsCapability or Install-WindowsFeature accordingly. Idempotent; requires elevation.
  • Profile AD (default), DNS, GroupPolicy, DHCP, ServerManager, All, or Custom.
  • Names When Profile=Custom, explicit capability/feature names (e.g. 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0' on client, 'RSAT-AD-PowerShell' on server).
  • DryRun Preview without installing.

Connects to: Local administrator on the runner host, Internet access for capability source download (client) or DISM/Servicing source (server)

Move-ADUserToOUreversibleMoves on-premises AD users into another OU, printing each source OU first and restoring accidental-deletion protection afterwards. Reversible: the first user's original OU is captured before the move.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • TargetOU required Target OU, e.g. 'OU=Leavers,DC=contoso,DC=com'.
  • Force Clear protection from accidental deletion to make the move, then restore it afterwards.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the moves without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Move-ADUserToOU; parameter_map=; state_map=; confirm=Move {UserNames} back to {TargetOU}? Only the first user's original OU was captured - check the run output if they came from different OUs.}

New-ADComputerAccountPrestages AD computer accounts in the right OU, singly or by CSV, and can delegate the domain join to a named user or group by granting only the four rights a join needs on that object.
  • ComputerNames One or more computer names to prestage. Required unless -CsvPath is used.
  • OUPath OU to create the accounts in. Default: the domain's Computers container.
  • Description Description recorded on each computer object.
  • Location Location recorded on each computer object.
  • ManagedBy Owner written to managedBy (user or group).
  • JoinPrincipal User or group allowed to join the machine to the domain, granted on this object only.
  • CsvPath CSV of computers to prestage. Headers: Name, OUPath, Description, Location, ManagedBy, JoinPrincipal.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the accounts that would be prestaged without changing anything.

Connects to: AD module (RSAT)

New-ADGroupsreversibleCreates on-premises AD groups singly or in bulk from a CSV, setting scope, category, description, managedBy owner and initial members in one pass. Skips groups that already exist.
  • GroupNames One or more group names to create. Required unless -CsvPath is used.
  • OUPath OU to create the groups in. Default: the domain's Users container.
  • Scope Global, DomainLocal or Universal. Default: Global.
  • Category Security or Distribution. Default: Security.
  • Description Description recorded on each group.
  • ManagedBy Owner written to managedBy (user or group).
  • InitialMembers Members to add to every group created (users or groups).
  • CsvPath CSV of groups to create. Headers: Name, OUPath, Scope, Category, Description, ManagedBy, Members (';'-separated).
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the groups that would be created without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Remove-ADGroups; parameter_map=; confirm=Delete the group(s) {GroupNames}? A deleted group's SID cannot be recreated, so any ACL referencing it is lost.}

New-ADOrganizationalUnitsCreates on-premises AD organizational units from top-down paths like 'Lakefront/Flats Operations', adding any missing parents. Skips OUs that already exist.
  • OUPaths One or more OU paths, top-down and '/'-separated. Required unless -CsvPath is used.
  • ParentPath Distinguished name the paths are relative to. Default: the domain root.
  • Description Description recorded on each OU created.
  • CsvPath CSV of OUs to create. Headers: Path, Description.
  • Unprotected Create the OUs without protection from accidental deletion.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the OUs that would be created without changing anything.

Connects to: AD module (RSAT)

New-ADUserAccountreversibleCreates on-premises AD user accounts singly, from a template user, or in bulk from a CSV. Generates a compliant password per account, copies the template's groups and attributes, and skips accounts that already exist.
  • SamAccountName sAMAccountName for the new account. Required unless -CsvPath is used.
  • GivenName First name.
  • Surname Last name.
  • DisplayName Display name. Default: 'GivenName Surname'.
  • UserPrincipalName UPN. Default: SamAccountName@<domain DNS root>.
  • EmailAddress Email address (mail attribute).
  • Title Job title.
  • Department Department.
  • Company Company.
  • Manager Manager (sAMAccountName, UPN, DN, or GUID).
  • OUPath OU to create the account in. Default: the template user's OU, else the domain's Users container.
  • Password Initial password. Leave empty to generate one per account: the log shows [REDACTED] and you get one Copy button.
  • CopyFromUser Existing user to copy OU, department, company, title, manager and group memberships from.
  • AddToGroups Groups to add the new account to, on top of any inherited from the template.
  • CsvPath CSV of accounts to create. Headers match the parameter names; AddToGroups is ';'-separated.
  • NoPasswordChangeAtLogon Do not require a password change at next logon.
  • StartDisabled Create the account disabled - useful for starters who begin later.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the accounts that would be created without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Disable-ADUserAccount; parameter_map=; confirm=Disable the account {SamAccountName}? AD accounts are disabled rather than deleted - a deleted account's SID cannot be recreated.}

Remove-ADGroupsDeletes on-premises AD groups after printing a full record of each one, refusing built-in and critical groups outright and non-empty, AdminSDHolder-protected or primary-group-referenced groups unless forced.
  • GroupNames required One or more groups (sAMAccountName, DN, or GUID).
  • Force Delete groups that still have members, and clear protection from accidental deletion.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Report what would be deleted, with full membership, without changing anything.

Connects to: AD module (RSAT)

Remove-ADPrivilegedGroupMemberreversibleRemoves one or more users from privileged AD groups only (Domain Admins, Enterprise Admins, Administrators, Operators, adminCount=1). Marked privileged: never auto-granted to a role.
  • GroupNames required One or more target groups (sAMAccountName, DN, or GUID).
  • UserNames required One or more users to remove (sAMAccountName, UPN, DN, or GUID).
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the memberships that would be removed without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Add-ADPrivilegedGroupMember; parameter_map=; confirm=Add {UserNames} back to privileged group {GroupNames}?}

Remove-ADUserFromGroupreversibleRemoves one or more users from one or more on-premises Active Directory groups. Reverse of Add-ADUserToGroup; never removes a user's primary group. Privileged groups (Domain Admins and similar) are refused; they use Remove-ADPrivilegedGroupMember.
  • GroupNames required One or more target groups (sAMAccountName, DN, or GUID).
  • UserNames required One or more users to remove (sAMAccountName, UPN, DN, or GUID).
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the memberships that would be removed without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Add-ADUserToGroup; parameter_map=; confirm=Add {UserNames} back to AD group {GroupNames}?}

Remove-ADUserProxyAddressreversibleRemoves email aliases from on-premises AD users' proxyAddresses. Reverse of Add-ADUserProxyAddress; refuses to drop the primary SMTP address unless forced.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • Addresses required Addresses to remove. Bare addresses are treated as smtp:.
  • Force Allow removal of the primary SMTP address, leaving no reply address.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the resulting address list without changing anything.

Connects to: AD module (RSAT)

Undo: @{script=Add-ADUserProxyAddress; parameter_map=; confirm=Add proxy address {Addresses} back to {UserNames}?}

Reset-ADComputerAccountDiagnoses broken computer trust relationships from the directory's own evidence (enabled state, machine password age, last logon) and repairs them - re-enabling the account, running Test-ComputerSecureChannel -Repair over WinRM, or resetting the account password for a rejoin.
  • ComputerNames required One or more computers (name, DN, or GUID).
  • Enable Re-enable the computer account if it is disabled.
  • RepairRemotely Run Test-ComputerSecureChannel -Repair on the machine over WinRM. Needs the machine online.
  • ResetPassword Reset the account password in the directory. Breaks the trust until the machine rejoins.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Report the diagnosis and the actions that would be taken, without changing anything.

Connects to: AD module (RSAT)

Reset-ADUserPasswordResets on-premises AD passwords against the PDC emulator, generating a compliant password per account when none is supplied. Optionally unlocks, clears an account expiry, and forces a change at next sign-in. Refuses krbtgt.
  • UserNames required One or more users (sAMAccountName, UPN, DN, or GUID).
  • Password New password. Leave empty to generate one per account: the log shows [REDACTED] and you get one Copy button.
  • GeneratedLength Length of generated passwords. Default: 16.
  • NoChangeAtNextLogon Do not force a password change at next sign-in - use for service accounts.
  • Unlock Also unlock the account if it is locked out.
  • ClearExpiration Also clear an account expiry date that would still refuse sign-in.
  • Server Domain controller to target. Default: the PDC emulator, which owns password changes.
  • DryRun Preview the accounts that would be reset without changing anything.

Connects to: AD module (RSAT)

Set-ADUserAttributesUpdates directory attributes (title, department, manager, office, phones, employee id and more) on AD users from parameters or a CSV. Writes only what differs and prints every change as old -> new, so it is safe to schedule against an HR feed.
  • UserNames One or more users (sAMAccountName, UPN, DN, or GUID). Required unless -CsvPath is used.
  • CsvPath CSV of users and attributes. Headers match the parameter names; SamAccountName or UserPrincipalName identifies the row.
  • Title Job title.
  • Department Department.
  • Company Company.
  • Office Office (physicalDeliveryOfficeName).
  • Manager Manager (sAMAccountName, UPN, DN, or GUID).
  • OfficePhone Office phone (telephoneNumber).
  • MobilePhone Mobile phone.
  • EmailAddress Email address (mail attribute).
  • Description Description.
  • EmployeeID Employee id.
  • StreetAddress Street address.
  • City City.
  • State State or province.
  • PostalCode Postal code.
  • ClearAttributes Attributes to empty, by LDAP name, e.g. 'manager','telephoneNumber'.
  • ExtraAttributes Extra attributes as 'lDAPDisplayName=value' pairs separated by ';'.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview every change as old -> new without writing anything.

Connects to: AD module (RSAT)

Set-ADUserManagerSets or clears the manager attribute on AD users from parameters or a CSV, walking the proposed chain first and refusing any change that would create a reporting loop. Skips users who already have the requested manager.
  • UserNames One or more users (sAMAccountName, UPN, DN, or GUID). Required unless -CsvPath is used.
  • Manager Manager to set (sAMAccountName, UPN, DN, or GUID).
  • ClearManager Empty the manager attribute instead of setting it.
  • CsvPath CSV with SamAccountName (or UserPrincipalName) and Manager columns.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Preview the manager changes without writing anything.

Connects to: AD module (RSAT)

Sync-ADGroupFromCsvMakes an AD group's membership match a supplied CSV or list, reporting the add/remove/keep difference first. Removals are opt-in and guarded against bad input by a maximum-removal percentage and an empty-list refusal.
  • GroupName required Group to synchronise (sAMAccountName, DN, or GUID).
  • CsvPath CSV holding the desired membership. Columns: Member, SamAccountName, UserPrincipalName or User.
  • Members Desired members given directly instead of by CSV.
  • RemoveExtra Remove members that are not in the desired list. Off by default - extras are reported only.
  • MaxRemovalPercent Refuse the run if removals would exceed this share of the current membership. Default: 50.
  • AllowEmpty Allow an empty desired list, which empties the group.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Report the difference without changing anything.

Connects to: AD module (RSAT)

Sync-ADUsersFromHRFeedReads the HR system's CSV drop from a share and keeps AD in step: starters created and switched on on their first day, leavers switched off on their last, transfers updated. Archives each file. Built to run nightly; refuses a run that would switch off too many accounts.
  • FeedFolder required Folder the HR system drops its CSV files into, e.g. \\fileserver\HRFeed (or a single CSV file). Columns: EmployeeId, FirstName, LastName, Title, Department, ManagerId, StartDate, EndDate.
  • DefaultOU OU for starters whose manager is not found. Default: the domain's Users container.
  • LeaverOU OU leavers are moved into, e.g. 'OU=Disabled Users,DC=contoso,DC=com'. Default: left where they are.
  • MaxLeavers Refuse the whole run if it would switch off more than this many accounts. Default: 5.
  • UpnSuffix UPN suffix for new accounts. Default: the domain's DNS name.
  • AsOfDate Treat this date (yyyy-MM-dd) as today. Use with DryRun to preview a future night's run.
  • Server Domain controller to target. Default: any writable DC.
  • DryRun Report every change without making it, and leave the file in place.

Connects to: AD module (RSAT)

Test-ADReplicationHealthValidates Active Directory replication by querying Get-ADReplicationPartnerMetadata and Get-ADReplicationFailure if the ActiveDirectory module is available, otherwise parsing 'repadmin /showrepl /csv' output; reports per-partner last-success time, replication latency, consecutive failure counts, and applies WARN/FAIL thresholds against latency.
  • Server Target DC FQDN. Default current host.
  • AllDomainControllers Iterate every DC in the domain (requires AD module).
  • LatencyWarnMinutes Latency WARN threshold in minutes. Default 30.
  • LatencyFailMinutes Latency FAIL threshold in minutes. Default 180.
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: AD module (RSAT) preferred, Else repadmin.exe in PATH (RSAT-AD-Tools)

Test-ADTargetConnectivityTroubleshoots an Active Directory target as the app sees it: RSAT module, the target's server and service account, DNS, ports 88/389/636/3268/9389, an LDAP bind that separates a bad password from a blocked AD Web Services port, and an AD-module read. Ends with plain-English findings. Read-only.
  • Server Domain controller or domain to test. Default: the AD target's server.

Connects to: AD module (RSAT)

Test-LdapPerformanceMeasures LDAP/LDAPS bind and search latency against directory servers using System.DirectoryServices.Protocols, supports Anonymous/Negotiate/Kerberos/Ntlm/Basic/External auth, configurable filter/attributes/scope, paged search, multi-iteration timing with min/avg/max and configurable percentiles (P50/P95/P99), and applies WARN/FAIL gating against search latency.
  • Server required Directory server hostname(s).
  • Port Port. Default 389 (or 636 with -UseSsl).
  • UseSsl Use LDAPS (TLS).
  • AuthType Anonymous, Basic, Negotiate, Kerberos, Ntlm, External. Default Negotiate.
  • Credential Bind credential.
  • SearchBase Search base DN (auto-discovered from RootDSE if omitted).
  • Filter LDAP filter. Default '(objectClass=user)'.
  • Attributes Attributes to retrieve. Default cn, sAMAccountName.
  • Scope Base, OneLevel, or Subtree. Default Subtree.
  • Iterations Bind+search iterations per server. Default 5.
  • PageSize Page size for paged search. 0 = no paging. Default 0.
  • Percentiles Percentiles to compute. Default 50,95,99.
  • SearchWarnMs Average-search WARN threshold (ms). Default 500.
  • SearchFailMs Average-search FAIL threshold (ms). Default 2000.
  • TimeoutSec Connection timeout in seconds. Default 15.
  • SkipCertCheck Skip TLS cert validation (LDAPS).
  • OutputFormat Object, JSON, or CSV. Default Object.
  • DryRun Preview action without executing.

Connects to: TCP 389 (LDAP) or 636 (LDAPS) to directory server

Unlock-ADUserAccountUnlocks locked-out AD accounts by name or across the whole domain, reading authoritative lockout state from the PDC emulator. Can report per-DC bad-password activity to find where a recurring lockout comes from.
  • UserNames One or more users (sAMAccountName, UPN, DN, or GUID). Omit when using -AllLockedOut or -ListOnly.
  • AllLockedOut Unlock every locked-out account in the domain.
  • ListOnly Report locked-out accounts without unlocking anything.
  • CheckAllDomainControllers Query every DC for bad-password activity to find where the lockout is coming from.
  • Server Domain controller to target. Default: the PDC emulator, which holds the authoritative lockout state.
  • DryRun Preview the accounts that would be unlocked without changing anything.

Connects to: AD module (RSAT)

Business systems · 21

ERP & BI 21

Demo-Reconcile-WithSampleDataRunnable end-to-end demo of cross-ERP GL reconciliation using inline sample data. No targets, no credentials, no network — call this to see exactly what the reconciliation output looks like during a live cutover. Useful for sales demos, onboarding, and smoke tests.
  • ReconcileScript Path to Reconcile-GLBalance-Legacy-vs-S4.ps1. Default: sibling file in this catalog.

Runs on the PowerScripts server; no connection needed.

Demo-VendorDrift-WithSampleDataRunnable end-to-end demo of cross-ERP vendor master drift detection. Synthesizes vendors across PeopleSoft, Epicor Kinetic, and S/4HANA with realistic drift (different payment terms, different postal codes, missing-from-one-ERP). No live connections needed.
  • DriftScript Path to Detect-Drift-VendorMaster.ps1. Default: sibling file in this catalog.

Runs on the PowerScripts server; no connection needed.

Detect-Drift-VendorMasterDetects vendor master drift across PeopleSoft, Epicor Kinetic, and SAP S/4HANA. Clusters vendors by normalized name+tax+postal hash, then flags clusters where payment terms, tax IDs, postal codes, or names disagree across ERPs.
  • PeopleSoftVendors required Vendor rows from PeopleSoft.
  • KineticVendors Vendor rows from Epicor Kinetic.
  • S4Suppliers Supplier rows from S/4HANA (output of ERP-SAP-S4HANA/Get-VendorMaster).
  • MinErpAppearances Minimum number of ERPs a cluster must appear in to be reported. Default 2.

Runs on the PowerScripts server; no connection needed.

Detect-SoD-Conflicts-S4Detects SAP S/4HANA users that hold conflicting PFCG role pairs (segregation-of-duties). Pulls active user-role assignments via OData and joins against a supplied CSV of conflict pairs. Outputs one row per user x triggered pair as SOX evidence (ITGC-AC-01).
  • ODataBaseUrl required S/4HANA OData base URL.
  • BearerToken required OAuth bearer token (service user).
  • ConflictsCsv required Path to SoD conflict pair CSV. Headers: RoleA,RoleB,ControlId,ControlDescription.
  • SapClient SAP client number. Default 100.
  • PageSize Page size for paginated reads. Default 5000.

Connects to: sap-s4-odata

Get-AzureAccessReportWho can change Azure: Owner, Contributor and access-admin role assignments on every subscription, named from Entra ID, with deleted, guest, disabled, inactive and direct assignments flagged. Optional HTML report for access reviews. Read-only.
  • Subscription Subscription names or ids, or 'All'. Default: All.
  • Roles Role names to list, or 'All'. Default: Owner, Contributor, User Access Administrator, Role Based Access Control Administrator, Key Vault Administrator.
  • InactiveDays No sign-in for this many days counts as inactive. Default: 90.
  • FlaggedOnly Only list assignments that need a look.
  • ReportPath HTML report with every assignment and what each flag means.
  • OutputPath Also write every assignment to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-AzureBackupReportIs Azure backed up? VMs with no backup, backups that failed or are out of date, failed jobs in the last 7 days and vaults with soft delete off. Optional HTML report for auditors. Read-only.
  • Subscription Subscription names or ids, or 'All'. Default: All.
  • StaleHours A last good backup older than this many hours is out of date. Default: 36.
  • JobDays Report failed backup jobs from this many days back. Default: 7.
  • IgnoreTag VMs with this tag are not expected to have a backup. Default: nobackup.
  • RunningVmsOnly Leave out VMs that are deallocated.
  • ReportPath HTML report with problems, failed jobs and every backed-up item.
  • OutputPath Also write every VM and backed-up item to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-AzureCostReportAzure spend by subscription, service and resource group, compared with the period before, with the biggest increases and drops, a day-by-day chart and a month-end projection. Optional HTML report. Read-only.
  • Subscription Subscription names or ids, or 'All'. Default: All.
  • Period LastMonth (default), MonthToDate or Last30Days.
  • CostType Actual (as billed, default) or Amortized (reservations spread over their term).
  • Top How many services, resource groups and changes to list. Default: 10.
  • MinChange Changes smaller than this amount are not listed. Default: 5.
  • ReportPath HTML report with the total, a daily chart, top services and resource groups, and what changed.
  • OutputPath Also write cost by subscription, resource group and service to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-AzureCredentialExpirationAzure certificates, secrets and keys about to expire - Key Vault, App Service, certificate orders and Application Gateway - with an EXPIRED/CRITICAL/WARN/OK status, soonest first. Optional HTML report. Read-only.
  • Subscription Subscription names or ids, or 'All'. Default: All.
  • DaysAhead Report items expiring within this many days, plus already expired. Default: 60.
  • IncludeAll Report every item with an expiry date.
  • WarnDays Days left at or below which an item is WARN. Default: 30.
  • CriticalDays Days left at or below which an item is CRITICAL. Default: 7.
  • ShowNoExpiry Also list enabled Key Vault secrets that never expire.
  • SkipKeyVault Skip Key Vault (many vaults take one call each).
  • ReportPath HTML report, soonest first, with portal links.
  • OutputPath Also write every item to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-AzureOrphanedResourcesFinds Azure resources nobody is using - unattached disks, spare public IPs, stopped VMs still billed, empty App Service plans, old snapshots and more - with what each cost over the last 30 days. Optional HTML report with portal links. Read-only.
  • Subscription Subscription names or ids to search, or 'All'. Default: All.
  • ResourceGroup Only these resource groups. Default: all.
  • SnapshotAgeDays Snapshots older than this many days are reported. Default: 90.
  • SkipFreeItems Leave out the free checks: network interfaces, security groups, route tables, availability sets and empty resource groups.
  • IgnoreTag Resources with this tag are left out, so anything kept on purpose stops showing up. Default: keep.
  • NoCost Skip the Cost Management lookup.
  • EstimateCurrency Currency for list-price estimates. Default: USD.
  • ReportPath HTML report with the monthly total, cost by check and every resource linked to the Azure portal.
  • OutputPath Also write every resource to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-AzureVmRightSizingVMs bigger than they need to be: Azure Advisor's suggested size and monthly saving, with each VM's average and busiest CPU over the last 30 days, plus Advisor's other cost advice. Optional HTML report. Read-only.
  • Subscription Subscription names or ids, or 'All'. Default: All.
  • Days Days of CPU history to look at. Default: 30.
  • LowCpuPercent Average CPU below this percentage counts as low use. Default: 10.
  • PeakCpuPercent Busiest CPU below this percentage counts as low use. Default: 50.
  • MaxVms Check the CPU of at most this many VMs. Default: 500.
  • VmsOnly Skip Advisor advice for reservations, savings plans and other resources.
  • IgnoreTag VMs with this tag are left out. Default: keep.
  • ReportPath HTML report with each VM, its CPU use and the suggested size.
  • OutputPath Also write every VM to this CSV file.
  • EmailTo Email the HTML report to these addresses, from the Output Email From mailbox in Settings > Preferences.
  • Cloud AzureCloud, or AzureUSGovernment for GCC High and DoD. Default: AzureCloud.
  • TenantId Tenant id. Default: the tenant PowerScripts is connected to.
  • ClientId App (client) id. Default: the PowerScripts app.
  • CertificateThumbprint Certificate thumbprint. Default: the tenant's certificate.
  • ClientSecret Client secret, only when the app has no certificate.
  • AccessToken An Azure Resource Manager access token to use instead of the app.

Connects to: graph

Get-GLBalancePulls a PeopleSoft GL trial balance for a given business unit, fiscal year, and accounting period via direct Oracle ODBC. Returns one row per (account, department, product) with debit, credit, and net amounts.
  • OdbcConnectionString required Oracle ODBC connection string bound to the PeopleSoft target.
  • BusinessUnit required PeopleSoft Business Unit code.
  • FiscalYear required Fiscal year, four-digit.
  • AccountingPeriod required Accounting period (1-12, plus 0 for BBF, 998/999 for adjustments).
  • Ledger Ledger name. Default ACTUALS.
  • RowLimit Max rows returned (0 = no limit).

Connects to: peoplesoft-odbc

Get-GLBalancePulls a SAP S/4HANA GL trial balance for a company code, fiscal year, and period via OData on I_GLAccountLineItem. Aggregates to one row per (GLAccount, Currency).
  • ODataBaseUrl required S/4HANA OData base URL.
  • BearerToken required OAuth bearer token.
  • CompanyCode required SAP company code (BUKRS).
  • FiscalYear required Fiscal year, four-digit.
  • FiscalPeriod required Fiscal period, 1-12 (or 13-16 for special periods).
  • Ledger Ledger code. Default 0L (leading ledger).
  • SapClient SAP client number. Default 100.
  • PageSize Page size. Default 5000.

Connects to: sap-s4-odata

Get-VendorMasterPulls the SAP S/4HANA supplier master (I_Supplier CDS view via OData) for a client, with optional country and changed-since filters. Paginates 5,000 rows per page.
  • ODataBaseUrl required S/4HANA OData base URL.
  • BearerToken required OAuth bearer token.
  • SapClient SAP client number. Default 100.
  • Country ISO country filter. Empty = all.
  • ChangedSince Only pull suppliers changed on or after yyyy-MM-dd. Empty = no filter.
  • PageSize Rows per page. Default 5000.

Connects to: sap-s4-odata

Get-WorkOrders-OpenPulls open (released, not closed) production work orders from Epicor Kinetic for one plant or all plants. Returns one row per job with part, quantities, and due dates. Building block for KPI rollup and cutover reconciliation.
  • RestBaseUrl required Kinetic REST base URL.
  • CompanyId required Kinetic company ID.
  • BearerToken required OAuth bearer token.
  • Plant Plant filter. Empty = all plants for the company.
  • PageSize Page size for paginated reads. Default 1000.

Connects to: epicor-kinetic-rest

Reconcile-GLBalance-Legacy-vs-S4Reconciles a legacy-ERP GL trial balance (from PeopleSoft or Kinetic) against an S/4HANA trial balance for the same period. Joins on a supplied account map and flags variances per absolute and percent tolerances. Used for S/4HANA cutover sign-off and parallel-run reconciliation.
  • LegacyRows required Legacy trial-balance rows (output of PeopleSoft Get-GLBalance or Kinetic BAQ runner).
  • S4Rows required S/4HANA trial-balance rows (output of ERP-SAP-S4HANA/Get-GLBalance).
  • AccountMap required Hashtable (legacy->s4) or path to CSV with headers Legacy,S4.
  • TolerancePerAccount Absolute tolerance per account in currency units. Default 1.00.
  • TolerancePercent Percent tolerance per account (0.001 = 0.1%). Default 0.001.
  • MaxFailRows Failure threshold. Default 0 — any FAIL row fails the reconciliation.

Runs on the PowerScripts server; no connection needed.

Refresh-PowerBI-DatasetTriggers a Power BI dataset refresh and polls the refresh history until Completed, Failed, or Disabled. Returns final status, duration, and error if any. Used to chain BI refreshes into ERP-extract orchestrations.
  • WorkspaceId required Power BI workspace (group) ID.
  • DatasetId required Power BI dataset ID.
  • BearerToken required Bearer token for the Power BI REST API.
  • NotifyOption Notify owners on failure. Default true.
  • TimeoutSec Max wait time in seconds. Default 1800.
  • PollIntervalSec Poll interval in seconds. Default 15.

Connects to: powerbi-rest

Run-BAQGeneric runner for any Epicor Kinetic Business Activity Query (BAQ). Executes a named BAQ via the BAQSvc REST endpoint and returns rows as PowerShell objects.
  • RestBaseUrl required Kinetic REST base URL.
  • CompanyId required Kinetic company ID.
  • BaqId required BAQ ID (case-sensitive).
  • BearerToken OAuth bearer token.
  • ApiKey Legacy API key.
  • BaqParameters BAQ parameter name=value pairs.
  • PageSize Max rows returned. Default 5000.

Connects to: epicor-kinetic-rest

Run-PSQueryRuns a named PeopleSoft Query through Query Access Service (QAS) and returns the row set as PowerShell objects. Generic runner reusable across any defined PS Query.
  • QasEndpoint required QAS SOAP endpoint URL.
  • QueryName required Defined PS Query name (case-sensitive).
  • Credential required Credential bound to the PeopleSoft target.
  • BindVariables Bind variable name=value pairs for the query.
  • MaxRows Max rows returned. Default 5000.

Connects to: peoplesoft-qas

Test-ConnectionHealth probe for a PeopleSoft Integration Broker REST endpoint. Confirms reachability, auth, and a sub-second round-trip on a known service operation.
  • IbBaseUrl required PeopleSoft Integration Broker REST base URL.
  • ProbeOperation Service operation path used as the probe. Default PT_PING.v1/ping.
  • Credential required Credential bound to the PeopleSoft target.
  • TimeoutSec Request timeout in seconds. Default 15.

Connects to: peoplesoft-ib

Test-ConnectionHealth probe for an SAP S/4HANA OData Gateway. Confirms reachability, auth, and that the service user has read access to a baseline CDS view.
  • ODataBaseUrl required S/4HANA OData base URL.
  • BearerToken OAuth bearer token (preferred).
  • Credential HTTP basic credential.
  • SapClient SAP client number (mandt). Default 100.
  • ProbeService OData service path used for the probe.
  • TimeoutSec Request timeout in seconds. Default 20.

Connects to: sap-s4-odata

Test-ConnectionHealth probe for an Epicor Kinetic REST endpoint. Confirms reachability, auth, and a sub-second round-trip on the Companies service for the bound company.
  • RestBaseUrl required Kinetic REST base URL.
  • CompanyId required Kinetic company ID.
  • BearerToken OAuth bearer token (preferred).
  • ApiKey Legacy API key.
  • TimeoutSec Request timeout in seconds. Default 15.

Connects to: epicor-kinetic-rest