Power-shell Script To Create User Folders And Set Permissions?

Nov 18, 2010

I am grabbing a text file with a list of users in it. I want to then create folders for all those people and then set explicit permissions on those folders to only allow the users and admin access to it. So for the create user folder, I have...

$Users = Get-Content "C:Users.txt"
ForEach ($user in $users)
{
$newPath = Join-Path \mycomputerUsers$ -childpath $user
New-Item $newPath -type directory
}

This works great as I now have 100 folders created. But how do I use something like....

$acl = Get-Acl "\mycomputerusers$"
$permission = "mydomain$users","FullControl","Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl.SetAccessRule($accessRule)
$acl | Set-Acl \mycomputerusers$$user

When I try to loop these together it says the folder already exists or the setaccessrule identity references could not be translated. how I loop it in with creating the folder? Or is there a way to just say...create folder based on this username, then take that username and make it the only admin on the folder along with the system admin?

View 3 Replies


ADVERTISEMENT

NTFS And Share Permissions - Cannot Allow User To Create New Files Or Folders

Nov 8, 2012

With NTFS and Share permissions is there any way I can allow a user to (in a specific folder):

- Edit and overwrite existing files (like a notepad file)
But
- Not be allowed to create new files or folders

I have spent quite a while staring at the special permissions screen. When reading about the meanings of the special permissions from the Microsoft, it says that the "Create Files/Write Data" permission allows for the overwriting of existing files but it also allows for the creation of new files. Is there some way i can have one without the other? Split the permission? I have also been told that there is a flaw to this as when you open a word document it creates a temp file in the folder where the word document is, and having permissions set this way would cause the word document not to be able to open because it couldn't create that temp file.

View 1 Replies View Related

Windows 7 Power User Vs User Permissions

Mar 30, 2010

With the power user group gone in Windows 7, has the standard User now gotten the permissions that the Power User had?

View 5 Replies View Related

User Folder - Create Your Own Special Folders

Aug 7, 2009

How to Create Your Own Special User Folder ?

View 0 Replies View Related

Change The Permissions On The Folders (the Locked Ones) Windows Says The Files/folders Doesn't Exist

Nov 10, 2010

i use BitLord to download random stuff anyways the Downloads Folder Shows up like this : Now when i open Nero up it shows this Weird thing is if i hover over the folder from normal window it says the Downloads folder is only 800mb (as it is only showing me one item) yet from Nero it says the folder is over 9 Gigs. Im set as Owner of the folder and i have all permissions set for me however i am still unable to see these files outside of nero and i don't know why.When i go and try to change the permissions on the folders (the locked ones) windows says the files/folders doesn't exist...

View 1 Replies View Related

Portion From Batch To Power-shell?

Sep 16, 2011

Im starting to work with powershell and try to port my old batch files.

1)I got this lines of Code, and I dont know who to convert them to power shell.The goal is to uninstall a software using the string found in the registry.[code]

2) In former times I used PsExe to remotly execute scripts on remote positions.What would be the best practice for power shell.

3) Another question is if it is posible with power shell to tell the system (Windows 7 and/or Xp)to do a Windows System Update and install all critical updates?

View 2 Replies View Related

Can I Do A Software Update Through Power Shell

Nov 5, 2011

So I have used Terminal in Fedora and I noticed we have power shell which seems much like Terminal, but what do you use it for? With Windows you can point and click on things I used Terminal in Fedora because I had to do certain updates or app installs that way.Can I do a software update through power shell? Where can I read how to start using Power Shell.

View 1 Replies View Related

Can Power-shell Replace Win-bash

Apr 14, 2011

i have been playing around with an industrial Linux-powered scanner, and was making okay progress under XP.This was made easier as I just ran some of the bash scripts through win-bash.Since moving to Windows 7 of course this no longer works, even if I disable UAC completely.I can only guess that the reason is that win-bash no longer works with Windows 7.My question is will powershell fill the gap?i.e. if this is my win-bash script what would the powershell equivalent look like, or am I barking up the wrong tree?ow I need an alternative sooner rather than later?

View 2 Replies View Related

Undeletable Shell Folders

Dec 21, 2009

I have set up custom paths for the shell folders in Windows 7. It works like it's supposed to except for one small detail. The system creates the folders "Pictures" and "Videos" in the default path (C:UsersUsername). As I mentioned I already have "My Pictures" and "My Videos" at another drive, so these folders shouldn't be there but when I try to delete them the system re-creates them. If I try to delete them again I get an error message stating I don't have permission to remove the folder, and if I try to open it it says "Access denied".

View 1 Replies View Related

Setting Shell Folders To Network Locations

Oct 16, 2009

I have a number of PCs connecting to a server where we house our personal folders. The server also houses music, basketball games, our photos, applications (like drivers and updates etc). On XP and vista I could update shell folders in registry to point each of the various locations (Like My Videos, My Documents, My Pictures etc), to a location on the server.

I updated the shell folder locations in registry only to find that it says location is unsupported because the network locations are not indexed

I have turned indexing off because it is a total waste of resources. We have everything stored on separate drives by category of item. For us, sedarching is not required, stuff is easy to find.

So how can I point the shell folders to a network location without turning on indexing?

View 2 Replies View Related

Set Read-only Permissions For Folders And Files?

Apr 23, 2011

I have an image of my the hard drive from my XP system on an external drive. I'd like to copy the entire file structure to the windows 7 hard drive, retaining the folder structure. Then I'd like to set all the folders, sub-folders, and files to read-only to protect myself from accidentally modifying or adding anything.

I am OWNER and the only user at this point. Will probably have one other user in the future whom I will want to also not have permission to modify these folders and files.

View 1 Replies View Related

Administrative Permissions And Copying Folders To Another Drive?

Feb 14, 2013

I am at my wits end with using windows 7. I am sure this must have been beaten to death on here and I am sorry but I am not sure how to word it to search for the answer.I hook up a spare HD to the USB with the same operating system and every ******** file I try to open on it I have to adjust it for administrator and da da da and I am sick of this, it will take forever to look at the data. How the heck to I fix this once and for all so I can just open what i want to ? I am the administrator...I don't want to be flagged about administrator anything any more.Secondly, if I want to back up data on a stick and there is already a folder of the same name it asks me if I want to merge it. No I dont so I change the name of the file to something different and it STILL always tells me there is a folder that has the same name do you want to merge i

View 3 Replies View Related

User Permissions For Programs?

Apr 1, 2011

I want to install the AI utilities that came with my Asus P8P67 Motherboard. When I have them installed, however, all of the non-admin accounts keep getting a string of 5-6 admin password requests to allow the programs to make changes. This happens upon every login and is more than a little tedious.I tried to run them as an administrator but that didn't change anything.I'm running Windows 7 64-bit Professional if it matter.

View 1 Replies View Related

Changing User Permissions?

Apr 14, 2012

I changed my user account to the Windows 7 Super Admin account because I am easily annoyed when a computer tries to lock me out of areas :P I am completely okay with this and have no issues. However, many people keep telling me all about how this is a very bad thing to do, e.g.if I get a virus the virus has full control of my system. I dont disagree with this and I can understand it, I just find the benefits of super admin outweigh the risk considering I generally know what I am doing, how to avoid viruses, etc.

I have considered though swapping back to a regular admin account and enabling UAC, however there is so much data, programs installed, program preferences, etc stored on my user, last time I changed it was about a month before things were back to normal. Does anyone know how I could just change the permissions of my current account (the super admin account)?

View 9 Replies View Related

Permissions For User On Network

Jan 31, 2011

I'd like to share a folder only for a certain user on a LAN. I'm on Windows 7-hp and the user is on XP-h. But when I go to assign permissions, the Location field only allows choices from my Windows 7 machine. If I put the XP user's name in directly, it flags that error.The Windows 7 user is an admin, and I've tried this with both an XP admin and user account.Surely there is some way to do this? Or alternatively, is there some way to do this via subnets?

View 2 Replies View Related

Moving User Folders - Additional Folders Appear

Jul 9, 2012

I have just done a clean install of Win 7 Pro 64. I have set up four accounts and for each one I have moved the user folders to a separate hard drive by using the Right Click Properties > Location > Move. I have done this for the following folders:

- Desktop
- Downloads
- My Documents
- Favorites
- Links
- My Music
- My Pictures
- Videos

I have done it exactly the same way on each account (and more than once! I've been imaging the disk and have restored backwards a few times.)

The problem is, on three of the accounts, when I move the My Music, My Pictures, and Videos then they do move correctly but three rogue folders appear named Music, Pictures and Videos. And I can't delete then since they are system folders.

But the weird thing is that this does not happen on one of the accounts!

how to get rid of the extra folders as they're cluttering up the users home folder and causing confusion.

View 3 Replies View Related

Administrator Account Cannot Take Control Or Change Permissions To System Folders

May 3, 2012

I'm running windows 7 ultimate and am trying to install some software off of a secure server at a remote location to my hard drive. The install fails every time because the my user account (an administrator) does not have full write permissions to the program files directory. I have tried taking ownership of the directory, but I don't have permission to change it from TrustedInstaller.

I turned on the built in administrator account and logged in through that, but there is no difference in permission level. When I attempt to change the permission level I get the following error dialog box: An error occurred while applying security information to:

C:Program Files (x86)
Access is denied

Then the following: Unable to save permission changes on Program Files (x86)Access is denied. I've been fighting with this for three days now and I consider myself pretty adept at typical windows bs. Yes, my UAC is set all the way down. That was the first thing I turned off. I also tried shutting down virus protection and firewalls to no avail. Any help here would be awesome since none of the posts I've been able to find say what to do when the admin can't take control from TrustedInstaller.

View 9 Replies View Related

Windows 7 User Account Permissions Corrupt?

Dec 18, 2012

I have Windows 7 account named Joe and it is an Administrator. Whenever I try to open a program or shortcut I get the "Open with..." dialog box and my option is Internet Explorer. Another odd thing that I discovered is that if I right click and select on "Run as Administrator" a program or shortcut will open as it should.I also created a seperate Administrator account named Jim and everything opened normally.

View 3 Replies View Related

Windows Media Center Setup Changed Permissions Of Music Folders

Jun 8, 2012

I've had an xbox for several years now. A few years ago I set up my computer to stream music to my xbox. It was cool for awhile and it worked fine, but eventually I just stopped using it. Today I decided I would use it again, but I found that wasn't working. No problem, its been a few years and sometimes settings just get lost. I go out on the web to find a guide again that would tell me how to do it, which led me to [URL]. At the part where I name my library and hit "OK", my "OK" button is grayed out. I know I could try and set up windows media center again. Again, I went to Xbox's support at [URL]. Everything was set up fine and dandy and everything worked.

I get back on my desktop to check something in my "My Music" folder. I get the "You need administrative privileges pop-up", which i thought was weird but i hit continue and it worked fine. Now, whenever i try to open ANY folder, sub-folder, or file, not only does it try to tell me I need admin privileges, once i hit continue it says that i don't have permission to that folder, etc. I think that if I were to go in and reset all the permissions that everything would be fine, but I've got a pretty large library and it could take forever to do that. Is there a simpler way, or a setting that I can change so that Windows Media Center doesn't block me from my own files?

View 5 Replies View Related

Grant Shared Permissions To A Single User From A Different Computer?

Jun 15, 2012

So I have just been setting up my new rig and, for several reasons, I was wanting to allow my desktop complete access to my laptop. However, I live in a very friendly household and my computer is in the main area. I allow other people to use the guest account on it all the time, but keep my own account with a password.

We also have many other computers on the same homegroup. I was wanting to allow just my account on my desktop complete access to some (or prefferably all) files on my laptop.

I tried going Local Disk (C Properties >> Sharing tab >> Advanced Sharing button >> 'Share this folder' checkbox >> Permissions button >> Add button

However when i had entered this I could not get my laptop to access any other locations that itself. It was there that I got stuck.

View 2 Replies View Related

How To Map Existing User Folders To New User Account

Jan 2, 2011

How do I map existing User Folders to a newly created User Account?I had existing User Folders on drive D. I added a new drive C and installed the OS on C but changed default location of User Folders to D. Now my existing User Folders are in the Users folder on D but there is no User Account associated with them. If I create a user account with the same name will it map to the existing folder within Users?I did a test of this. I created a folder called Test within Users then created a User account called Test and logged in. It created another folder within Users called Test.Computername.

View 2 Replies View Related

Power Plan - Create Shortcut To Change Power Plan

Aug 23, 2009

How to Create a Shortcut to Change Power Plans in Windows 7 ?

View 0 Replies View Related

Power Options Shortcut - Create

Feb 11, 2013

How to Create a Power Options Shortcut in Windows 7 ?

View 0 Replies View Related

Cannot Create Folders?

Mar 29, 2012

I have always been able to create sub folders by using the menus or by right clicking on the highlighted folder. All of a sudden this capability is gone. Nothing happens when I click on "New Folder" in the top menu. If I highlight the folder and rignt click the only choice given me is to create a "Briefcase."

View 1 Replies View Related

Cant Create New Folders

Dec 30, 2011

my lap top (toshiba running windows 7 32 bit) is only 1 year old and it has been acting insane as of late. i have lost all my music/pix/docs. everything.. that was mainly my fault for now backing it up but anyways. right now it seems to be working normal except for ONE PROBLEM, i cant create new folders. i have searched and found some people with the same problem but they dont have the option there. i have the option..i click it..and it says this." unexpected error is keeping your from creating the folder. if you continue to receive this error, you can use the error code to search for help with this problem. 0x800700003: the system can not find the path specified:I'm not sure if i get this everywhere. i mean its weird i can creat a new folder on the desktop but if i go in to the music folder and try then i get the above message.

View 9 Replies View Related

Custom Power Plan - Create Or Delete

Mar 27, 2010

How to Create or Delete a Custom Power Plan in Windows 7 ?

View 0 Replies View Related

Can't Create Compressed Folders

Jul 7, 2012

I have recently uninstalled 7-zip from my computer and now there is no option in the right click menu to create a zipped folder. i need this back as i have files to unzip but windows says there is no software to do this.

windows 7 x64
4GB Ram
Home Premium

View 3 Replies View Related

Cannot Create New Folders On Desktop

Mar 20, 2011

I don't know what I downloaded that caused the problem, but now when I try to make a new folder on the desktop of my new Windows 7 computer, I have only the following choices: Shortcut, Bitmap Image, Contact, Microsoft Word Document, Journal Document, Microsoft Powerpoint Presentation, Text Document, Microsoft Excel Worksheet, and Briefcase. No new folder choice.

View 4 Replies View Related

Create Power On Password In Laptop DELL Inspiron?

Jan 16, 2013

how to create power on password in laptap DELL inspiron.

View 3 Replies View Related

How To Create Custom CLSID Folders

Oct 15, 2012

I'd like to create a custom CLSID folder. How to do so?

View 5 Replies View Related

Can't Create A New User

Aug 16, 2010

I tried to create a new user, and every time I try to switch to it, restarting my computer, or switching users, or turning off my computer then back on. It logs on, then says logging off right away.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved