Forum Discussion
Chris_White_81
Sep 27, 2022Copper Contributor
Copy a OVPN file in Powershell from Intune
Sounds easy, my powershell script works fine if i run it on my machine, it copies the file into the %USERPROFILE%\OpenVPN\config folder. Its packaged up using the Intunewinapp program, but when i put...
Moe_Kinani
Sep 27, 2022Bronze Contributor
Hi Chris,
Have you tried to use this C:\Users\%USERNAME%\openvpn\…?
This should do it if you run it as Run As User (Install Behavior).
Moe
Chris_White_81
Sep 28, 2022Copper Contributor
So, if i replace $env:USERPROFILE\OpenVPN\config\ with C:\Users\%USERNAME%\openvpn\config\ it wont run in powershell, runs ok from the run command but powershell doesnt like that format
- Sep 28, 2022What happens when using a * wildcard instead of the username variable?
- Chris_White_81Sep 28, 2022Copper ContributorFrom being deployed by endpoint i mean, because it runs fine if i run it on the local machine. its just the remote installation that fails
- Moe_KinaniSep 28, 2022Bronze Contributor
Hi Chris,
You may need to change you powershell script to the one below, I have test it on my machine now.
$Path = New-item -ItemType directory -force -path "c:\users\%username%\OpenVPN\config\"
Copy-item -path $Source -Destination $path -Recurse -ForceUPDATE:
My test has not work, I will update you soon
- Chris_White_81Sep 28, 2022Copper ContributorNo luck, im wondering if theres something else at play here on the client machine. Can endpoint protection stop these powershell scripts from running?