You may receive the following error[s] when exported JSON file paths are longer than 260 characters:
New-Item : Could not find a part of the path 'C:\Users\UserFolder\Repos\AADExporter\[ I Used My Tenant GUID ]\
OnPremisesPublishingProfiles\ApplicationProxy\ConnectorGroups\[GUID]\Applications\[GUID]\[GUID].json'.
At C:\Program Files\WindowsPowerShell\Modules\AzureADExporter\1.0.957478\Export-AzureAD.ps1:136 char:101
+ ... 00 | Out-File (New-Item -Path "$($parentOutputFileName).json" -Force)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\Users\...\....json:String) [New-Item], DirectoryNotFoundExce
ption
+ FullyQualifiedErrorId : NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand
A workaround to this is to enable long paths via the Windows registry or a GPO setting. Run the following from an elevated PowerShell session and then close PowerShell before trying your export again:
You may receive the following error[s] when exported JSON file paths are longer than 260 characters:
A workaround to this is to enable long paths via the Windows registry or a GPO setting. Run the following from an elevated PowerShell session and then close PowerShell before trying your export again:
Credit: @shaunluttin via https://bigfont.ca/enable-long-paths-in-windows-with-powershell/ and https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell.
It might be worth adding this info to the README.