In this article we would copy administrative privileges of one user to another. It is very tedious task to manage custom privileges using access management console.

Let us assume we have a new person joining in team and he needs to be provided custom privileges as other team mates. The shortest and easy way to do this is using Powershell.

First we need to create administrator with custom which you can do by using information from my previous article.

Now we have custom user. Let us assume the name of user joining is Adam and the older person is Sandy.

First we need all the folders and privilege detail for Sandy. We can extract that information using below command. We would store that data in variable $data.

$data = Get-XaAdministratorFolder domain\Sandy | Select folderpath,@{name=’privilege’;expression={[string] ::join(“;”, ($_.folderprivileges))}}

Now $data is our 2D array with columns folderpath and privilege.

Now we need to copy this privilege to Adam’s account. We can do that using below command.

$data | foreach{ add-xaadministratorprivilege domain\Adam -folderpath $_.folderpath -folderprivileges ( $_.privilege -split ‘,’ )}

Here we have used –split because there are multiple values in privilege column and we need to tell powershell to take multiple values.

I hope this would be helpful, feel free to comment and share if you think it is meaningful.

Leave a Comment

Your email address will not be published. Required fields are marked *