Browse Category

Permissions

Copy Folders to a list of IP Addresses using Powershell

I created this script to copy a specific directory over the network to a bunch of computers. This is handy if you don’t have a deployment program like Altiris or anything else that can be automated with a click of a button or two.

The script will read a CSV file, which will contain the IP Address of the computer you want to copy the files over to. Optionally, you can have it set permissions to the destination folder if the computer is on (as seen in the script notes) after the copy is done. Afterwards, it will keep looping to the next entry in the list.

This will run in a loop and output information in a text file as a log. Pretty handy to see if it set it correctly or not. I do notice one issue which is that if you have a ton of files in the directory, it will log that in the log file. In the future, I might create separate log files per user folder to lessen the amount of data in the one log file.

This script has been tested on Windows 8.1. Make sure the execution policy for Powershell is set as Unrestricted while running this script and then turning it back on to Restricted.

Keep Reading

Set Folders as Read Only using Powershell

Awhile back, I had to create a script that set permissions on a folder to Read Only on a Windows Server. Trying this as a batch file was more difficult than with Powershell.

The script will read a CSV file, which will contain the username and folder that you want to set as read only. The child folders will inherit the Read Only permission from the folder it sets as Read Only for that user.

This will run in a loop and output information in a text file as a log. Pretty handy to see if it set it correctly or not. I do notice one issue which is that if you have a ton of files in the directory, it will log that in the log file. In the future, I might create separate log files per user folder to lessen the amount of data in the one log file.

This script has been tested on Server 2008/R2 and Server 2012/R2. Make sure the execution policy for Powershell is set as Unrestricted while running this script and then turning it back on to Restricted.

Keep Reading