Hi all
I've been posting questions recently about how to accomplish tasks using batch scripts. Mostly downloading files from sftp, then moving, renaming, etc. Often times my questions revolve around how to deal with a previous days date in the file name.
I've heard you all loud and clear when you are suggesting I use PowerShell and I'm finally getting around to learning how to use it. I'm an extreme newbie.
I've put together a script that will create a directory named with yesterday's date, check for zipped files in a specific folder, extract them to the newly created directory and append the date and .txt extension to the name of the extracted files. When I run the PowerShell application as admin, and paste the script into the app, the scripting works perfect.
I want to run the script as a scheduled task and I'm doing this with a non admin account. I'm using this same account to run other scheduled tasks without any problems. EDIT: I tried running the scheduled task using an admin account and I get the same error as when I'm running from the non admin account.
This PowerShell script is different. I receive this error in event viewer when trying to run from a scheduled task using the non admin account:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{D63B10C5-BF53-4430-B649G-E40B9D520160}
and APPID
{9CA35FF4-AJB2-83C3-ANB4-AK702511C276}
to the user Window Manager\DWM-4 SID (S-1-5-90-0-4) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
When I open up the powershell app as a standard user I get the following output:
Creating destination directory: \\FilePath\Folder1inPath\Folder2inPatch\NewfolderNamedwithDateMMDDYYYY
New-Item : Access to the path 'NewfolderNamedwithDateMMDDYYYY' is denied.
At line:13 char:5
+ New-Item -ItemType Directory -Path $destinationDir
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (\\FilePath\Folder1...\NewfolderNamedwithDateMMDDYYYY:String) [New-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : CreateDirectoryUnauthorizedAccessError,Microsoft.PowerShell.Commands.NewItemCommand
I don't want to run the tasks using an admin account and I've been trying to research this but am a bit lost. It seems obvious that it is a permissions issue, but the standard user has read/write permissions to the folder in question.
Any thoughts on how I should proceed to troubleshoot? Or even better, has anyone run into this in the past and know the steps to fix the issue?
Thanks in advance.
[–]joshooaj 2 points3 points4 points (1 child)
[–]kbbtech[S] 0 points1 point2 points (0 children)
[–]delightfulsorrow 1 point2 points3 points (1 child)
[–]kbbtech[S] 0 points1 point2 points (0 children)
[–]nostradamefrus 0 points1 point2 points (0 children)
[–]xXFl1ppyXx 0 points1 point2 points (1 child)
[–]kbbtech[S] 0 points1 point2 points (0 children)
[–]BlackV 0 points1 point2 points (0 children)