I created a quick-and-dirty little script that creates an AD group, adds a user to it and also publishes an RDP XenApp application within Citrix to the relevant user via the newly-created AD group.
I was quite pleased with myself when I pulled this little beauty off because we’ve got hundreds of the bleeders and now all I have to do is enter the user’s SamAccountName and the name of the Windows 7 machine and the script does the rest.
However, I’ve hit a wee snag whereby the Citrix server won’t recognise the AD group created earlier on in the script if it has a different logon server to my local machine where I run the script from.
What I would like to do is have my script write the new AD group to the same domain controller that the XenApp Data Collector authenticates against. (Obviously I don’t want to wait for replication).
What I guess I’m looking for is for the script to perform a “$env:LOGONSERVER” against a remote machine (i.e. the XenApp Data Collector) and then assign that to a variable. Is that possible?