Administrator, Application Virtualization, Centralized Computing, Citrix, Farm, Microsoft, PowerShell, Presentation Server, Script, Server, Xenapp

Copy administrative privileges among users using Powershell for Citrix Xenapp

April 28, 2015

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.

You Might Also Like

No Comments

Leave a Reply