Solved

Script to backup file permissions on all drives

Posted on 2011-09-23
3
301 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
  • 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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