Jump to content
Welcome to our new Citrix community!
  • 0

Automate: Export and Import DDC Administrators from DDC1 console to another DDC2 with task scheduler


Bit-101

Question

Here´s an example of how I do it now. But the problem is, this is not an automated job from a script server with task schelduer.

I wonder if someone has some experience of doing this with task schelduer (script server/ remote computer) as a regular background job?

Add-PSSnapin Citrix*
#Export delgated admin and roles from
$administrators = Get-adminAdministrator -Adminaddress DDC1 | Select Sid, Name, @{Name="Rights";Expression={$_.Rights.RoleName}}
$administrators | Export-CSV C:\temp\administrators_test.csv

$admins = Import-Csv "C:\Temp\administrators_test.csv"
foreach($admin in $admins)
    {
        #New-AdminAdministrator -AdminAddress DDC1.example.mydomain.com -Enabled $True -Name $admin.Name
        #Add-AdminRight -Scope "All" -Role $admin.Rights -Administrator $admin.Name
        write-host "Adding new admin $($admin.Name)"
        write-host "Adding Right to $($admin.name) with rights $($admin.rights)"

    }
#uncomment row 8 and 9 if you want to export delegated admin and roles to new destination example: DDC2
#comment-out row 11 and 12 if you dont want to see a example what rendering in .csv file
#The below generate code in studio so we can see what parameters to use
#New-AdminAdministrator  -AdminAddress "DDC1.example.mydomain.com:80" -Enabled $True -Name "Example\admin1"
#Add-AdminRight  -AdminAddress "DDC1.example.mydomain.com:80" -Administrator "CORP\admin1" -Role "Full Administrator" -Scope "All"

 

Really appreciate your answer

 

:)

Link to comment

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...