• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3167
  • Last Modified:

Windows 2008 Server - Export Folder permissions to a file or XML

Our server is acting strange due to a virus passing through our virus scanner. Our backups is not restoring folder permissions properly.

Does anyone know if there is either an application that can nicely capture (export) Windows 2008/NT Security Permissions, or possibly a working script ?

I have tried a few scripts that export in a weird unreadable fashion.

This request is pretty urgent...

Thanks in advance.
1 Solution
Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
Can you not use CACLS command and pipe the result to a text file?

CACLS - Display or modify Access Control Lists (ACLs) for files and folders


Sumit GuptaSystem and Virtualization EngineerCommented:
Export Mailbox Folder Permissions

Export-MessageOps.FolderPermissions exports all the folder permission on a particular folder to a file.

Export-MessageOps.AllFolderPermissions exports all the folder permissions from a particular mailbox in a folder path to an xml file.

To exports all the folder permission on a particular folder to a file:

Export-MessageOps.FolderPermissions –p $ewsprofile –id mailbox@domain.com –fp \\Inbox –filename c:\perm\Folderpermisions.xml

To export the permission from a particular mailbox:

Export-MessageOps.AllFolderPermissions –p $ewsprofile –id mailbox@domain.com –filename c:\perm\MailboxPermisions.xml

Import Mailbox Folder Permissions

Import-MessageOps.FolderPermissions imports all the folder permissions of a particular mailbox folder from a file exported with Export-MessageOps.FolderPermissions.

Import-MessageOps.AllFolderPermissions imports all Mailbox folder permissions from a file exported with Export-MessageOps.AllFolderPermissions.

If the ACE already exists on the mailbox folder, the ACE will either be updated with the permission stored in the file or it will be added.

Both cmdlets have the following parameter:

Clearexisting : Boolean parameter with two possible values: $true or $false. This parameter controls the removal of an existing ACE that isn’t in the export file. Set to$false by default.
To import exported Mailbox permission and clear any existing permissions:

Import-MessageOps.FolderPermissions –p $ewsprofile –id mailbox@domain.com –fp \\Inbox –filename c:\perm\Folderpermisions.xml –Clearexisting $true

To import exported Mailbox permission and clear any existing permissions:

Import-MessageOps.AllFolderPermissions –p $ewsprofile –id mailbox@domain.com -filename c:\perm\ MailboxPermisions.xml –Clearexisting $true
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now