Solved

Script to backup file permissions on all drives

Posted on 2011-09-23
3
306 Views
Last Modified: 2012-05-12
I am going to be doing lots of work on our file servers over the weekend and it would be good to have backups of all the file permission on all servers.

Can anyone help me with a script that will

Create c:\temp (if it doesn't already exist)
Identify all the drive letters that are in use on the server
Use SubInAcl to backup the file permissions to C:\temp\%computername%_Driveletter_Date.txt

I can then add this as a computer startup script as all the servers will be rebooted before work starts!

Thanks

Aidan
0
Comment
Question by:aideb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
ReneGe earned 500 total points
ID: 36594451
Here you go.

All you have left, is to do your SubInAcl command line.


@ECHO OFF

SETLOCAL enabledelayedexpansion

SET TempFolder=c:\Temp

IF NOT EXIST "%TempFolder%" MD "%TempFolder%"

FOR /F %%A IN ('WMIC logicaldisk where drivetype^=3 get caption ^| FINDSTR :') DO (
	SET DriveLetter=%%A
	SET DriveLetter=!DriveLetter::=!
	ECHO SubInAcl command line >"%TempFolder%\%computername%_!DriveLetter!_%Date%".txt
)


PAUSE

Open in new window

0
 
LVL 2

Author Closing Comment

by:aideb
ID: 36902148
Excellent will use this on our next migrations

Thanks!
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 36903077
You'r welcome
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question