Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.