Logon script for Citrix Xendesktop to create shared folder based on IP address

2

This is a bit over my head, but I've been tasked with writing a script to create a shared folder per login, based on the third IP address octet of the client device, ( thin client terminal).

It's going to be a VDI setup with Windows 10 desktops, so my thought process is to run a command on login that queries the current session, passes that to a reg query (since the client IP is stored here, running ipconfig will give the IP of the xen server), then passes the results of that into another command that creates a symlink to a folder based on the output.

I'm able to get the registry value, but the challenge for me is taking the results and making them useful...this is where my lack of experience is really hurting me.

This is what I have so far

for /f "tokens=2-4" %a in ('query session') do @if "%a"=="%username%" if "%c"=="Active" reg query hklm\software\citrix\ica\session\%b\connection /v ClientAddress

Any help would be greatly appreciated.

gwarokk

Posted 2018-08-24T13:39:28.853

Reputation: 21

Please provide a screenshot what you have in the hklm\software\citrix\ica\session%b\connection to understand what data you get from the registry. Also please provide a sample path construction for a shared folder – Hardoman – 2018-08-26T14:07:45.673

In general I do not see any problem in putting the IP address into a variable using SET command inside DO () cycle and then, MKDIR with this variable to create a folder. (Of course a script must have proper permissions to create folders on the share!) – Hardoman – 2018-08-26T14:12:58.983

No answers