Export-ZeroPortalConfigurationScript

Writes the portal's current state as a RUNNABLE PowerShell script.

Syntax

Export-ZeroPortalConfigurationScript [-Path <string>] [-IncludePolicies] [-UseSid]

Beschreibung

Unlike Export-ZeroPortalConfiguration (JSON for machine round-trips), this produces individual, readable statements - one cmdlet call per object - so the result can be executed line by line, used as a test script for the cmdlets, or as a starting point for a new portal.

Sections: configuration values, internal accounts, portal groups + members, role assignments, MSIX packages + entitlements, App-V packages + entitlements, connection groups, policy building blocks.

NOT exported (cannot be): passwords of internal accounts (hashes stay in the portal), sensitive configuration values, and package binaries - the import statements reference the repository paths the portal knows.

Parameter

-Path <string>

Target .ps1 file. Defaults to the desktop.

-IncludePolicies <switch>

Also emit the policy building blocks (XML here-strings; makes the file large).

-UseSid <switch>

Emit raw SIDs instead of account names. Names are the default because they survive a rebuilt test domain - SIDs do not. Use this when names are ambiguous or the target directory cannot be queried at replay time.

Beispiele

Export-ZeroPortalConfigurationScript
Export-ZeroPortalConfigurationScript -Path C:\temp\zp.ps1 -IncludePolicies