Forum Discussion
darangua
Feb 03, 2020Copper Contributor
Access denied when I want create to File in Powershell
Hi, Please, your help me! I have problem to access denied, when i want create to file. I have the account in the group administrator. I valued the permission in the tab security and i have admini...
- 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
HidMov
Feb 03, 2020Steel Contributor
Hi darangua
If I remember correctly the C:\ drive is normally locked down extra tight to stop files appearing in the root. Are you able to use another location (i.e. C:\outputfolder)? If not, can you let me know what OS you are using (i.e. Windows 10 home, Server 2019 etc) and if this is a domain joined computer?
Thanks,
Mark
- daranguaFeb 03, 2020Copper Contributor
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.ExportClixmlCommandRegards.
- HidMovFeb 03, 2020Steel Contributor
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
- RokeJulianLockhartDec 19, 2024Brass Contributor
Strange that the error message doesn't explicitly state this.