Forum Discussion
Access denied when I want create to File in Powershell
- Feb 03, 2020
Hi darangua
I reread your post - I missed something in the original.
When you export out, you need to name the exported file name, not just the folder location. Try:
$cre | Export-Clixml -Path c:\test\name.xml
This will export out the name.xlm file in the test folder.
The result:
Hope this helps,
Mark
Hi HidMov ,
I trying with another path and the same error.
The error is S.O Windows 10 pro and Windows server 2019 Standard, the computers in domain
Error:
PS U:\> $cre | Export-Clixml -Path C:\Test
Export-Clixml : Acceso denegado a la ruta de acceso 'C:\Test'.
En línea: 1 Carácter: 8
+ $cre | Export-Clixml -Path C:\Test
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Export-Clixml], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.ExportClixmlCommand
Regards.
Hi darangua
I reread your post - I missed something in the original.
When you export out, you need to name the exported file name, not just the folder location. Try:
$cre | Export-Clixml -Path c:\test\name.xml
This will export out the name.xlm file in the test folder.
The result:
Hope this helps,
Mark