Usage : Run the script in a session with AD privileges. Use -WhatIf:$false to perform the export.
You can invoke PowerShell scripts or script blocks in an elevated context with sudo or test your credentials against the local system or an Active Directory domain ...