0

Does anybody know why I can't access the folder where my powershell scripts are in windows 2008 Ent. When I try to create a script with textpad it craps out. When I try and execute a c# powershell app, which is stored on a win 2003 drive, it craps out with an access exception as well. I've set powershell execution policy to unrestricted for both normal users and admin users bu 'run as admin' on powershell, but it doesn't seem to make a difference. There must be a policy setting, doesn't allow scripts access to a directory, but where, and how to set it.

Any help would be appreciated.
scope_creep

4 Answers 4

1

The reason this happened because the inherited permissions copying the scripts from another NTFS drive.

1

Your execution policy is probably set too strict. See Running Windows PowerShell Scripts

0

Does anybody know why I can't access the folder where my powershell scripts are in windows 2008 Ent?

It sounds like the OP is trying to access files over a network share (to a Windows 2003 server), and having access permissions issues. I don't see this as a Powershell-specific question so far.

Double-check the permissions on the Share (try setting Everyone to Full Control). This won't give "everyone" full control, it just means that if a user has the NTFS rights for Full Control, they can use them.

Then double-check the NTFS permissions (Properties/Security) on that folder (do this on the Windows 2003 server where the folder is physically located). Make sure your user has Full Control on it.

0

We do need some precise detail on the errors you are getting - "craps out" clearly indicates failure but doesn't really help nailing the root cause.

You may be running into Code Access Security issues with your C# application - the .NET framework enforces CAS policies in addition to the NTFS access permissions that others have mentioned. You can find more details on the concepts from Microsoft here, some worked examples at The Code Project here and some discussion on approaches to resolving this here . A common problem with CAS presents itself when applications execute without issue when located on a local hard drive but fail when copied to a network share and attempts are made to execute from there.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.