Untested, but should work. 
code:
; -- Originally discussed at - http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=002825
; -- Thanks ceej for pointing out the solution!
; -- Perms and stuff discussed at - http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=002078&p=
; -- Thanks Shawn for Perms "port over!"
;Use the wtsapi32.dll from VBS
; VB Constant declarations for WTS_CONFIG_CLASS
$WTSUserConfigInitialProgram = &H0 ; string
$WTSUserConfigWorkingDirectory = &H1 ; string
$WTSUserConfigfInheritInitialProgram = &H2 ; DWORD
$WTSUserConfigfAllowLogonTerminalServer = &H3 ; DWORD
; Timeout settings
$WTSUserConfigTimeoutSettingsConnections = &H4 ; DWORD
$WTSUserConfigTimeoutSettingsDisconnections = &H5 ; DWORD
$WTSUserConfigTimeoutSettingsIdle = &H6 ; DWORD
; Client device settings
$WTSUserConfigfDeviceClientDrives = &H7 ; DWORD
$WTSUserConfigfDeviceClientPrinters = &H8 ; DWORD
$WTSUserConfigfDeviceClientDefaultPrinter = &H9 ; DWORD
; Connection settings
$WTSUserConfigBrokenTimeoutSettings = &HA ; DWORD
$WTSUserConfigReconnectSettings = &HB ; DWORD
; Modem settings
$WTSUserConfigModemCallbackSettings = &HC ; DWORD
$WTSUserConfigModemCallbackPhoneNumber = &HD ; string
; Shadow settings
$WTSUserConfigShadowingSettings = &HE ; DWORD
; User Profile settings
$WTSUserConfigTerminalServerProfilePath = &HF ; string
; Terminal Server home directory
$WTSUserConfigTerminalServerHomeDir = &H10 ; string
$WTSUserConfigTerminalServerHomeDirDrive = &H11 ; string
$WTSUserConfigfTerminalServerRemoteHomeDir = &H12 ; DWORD
;*************************************************************************
;*************************************************************************
$TSCFG= CreateObject("UserConfig.TSUserConfig")
$oFs = CreateObject("Scripting.FileSystemObject")
; -- Grab the current domain you are running this script from
$WshNetwork = WScript.CreateObject("WScript.Network")
TSCFG.Domain = WshNetwork.UserDomain
; -- If you want to manually set this, uncomment the next line and comment the previous two
$TSCFG.Domain = "MYDOMAIN"
;TSCFG.Domain = InputBox("Type The Domain name")
; -- Set the server where the shares reside
$ShareServer = "SHARESERVER"
$Debugger = "_No" ;If you want to see visual results, set this to be "_Yes"
? "Type a User Name"
GETS $TSCFG.UserName
If $TSCFG.UserName = ""
? "No UserID input provided. Stopping script now."
exit
EndIf
;We need to check and if need be create some folders for this user..
; Capture the name of the server are you adding the share to
TextShare = "\\" + $ShareServer + "\D" + Chr(36)
; Setting the user$ variable - jdoe$ - Hidden shares don't show when browsing to a server
$TextUserN = $TSCFG.UserName + Chr(36)
; Setting the user1$ variable - jdoe1$ - Hidden shares don't show when browsing to a server
; Why are we using a jdoe1$ ?? This server has other shared drives for local Corporate User too.
$TextUserNM = TSCFG.UserName + "1" + Chr(36) ; Created for home_dir
; Path for user folders
$Homedir = $TextShare + "\Citrix_Homedir"
$Profiles = $TextShare + "\Citrix_Profiles"
$ Now let's create a variable to work with - \\SERVER\users\jdoe
$ Directory to save
$UserProfileDir = $Profiles + "\" + $TSCFG.UserName
; Check existence for folder
If $Debugger = "_Yes"
If $oFs.FolderExists($UserProfileDir)
?"The citrix profiles folder " + UserProfileDir + " already exists."
endif
endif
$UserHomeDir = $Homedir + "\" + $TSCFG.UserName
; Check existence for folder
If $Debugger = "_Yes"
If $oFs.FolderExists($UserHomeDir)
?"The citrix Home_dir folder " + UserHomeDir + " already exists and we are continuing."
endif
endif
; Create folder Profiles
If Not $oFs.FolderExists($UserHomeDir) $oFs.CreateFolder $UserHomeDir
If Not $oFs.FolderExists($UserProfileDir) $oFs.CreateFolder $UserProfileDir
; Create share
$FservObj = GetObject("WinNT://" + $ShareServer + "/lanmanserver")
If $oFs.FolderExists("\\" + $ShareServer + "\" + $TextUserNM)
If $Debugger = "_Yes"
?"The share \\" + $ShareServer + "\" + TextUserNM + " already exists." + " Continuing..."
endif
else
; Create the share for the server jdoe1$
$newshare = $FservObj.create("fileshare",$TextUserNM)
; Set the path for the share on the server - D:\Users
$newshare.path = "D:\Citrix_Homedir\" + $TSCFG.UserName
$newshare.setinfo
?"The folders for " & TSCFG.UserName & " and share have been created."
endif;-- Query the information for debugging - uncomment the next three lines to see this
;MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerProfilePath)
;MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerHomeDir)
;MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerHomeDirDrive)
;-- Set some information
$TSCFG.SetUserConfig $WTSUserConfigfAllowLogonTerminalServer, 1
$TSCFG.SetUserConfig $WTSUserConfigTerminalServerProfilePath , "\\" + $ShareServer + "\CITRIX_PROFILES\" + $TSCFG.UserName
$TSCFG.SetUserConfig $WTSUserConfigTerminalServerHomeDirDrive , "H:"
$TSCFG.SetUserConfig $WTSUserConfigTerminalServerHomeDir , "\\" + ShareServer + "\" + TSCFG.UserName + "1" + chr(36)
?"The User Profile and Home Drive Server have been set for " + $TSCFG.UserName + "and may take up to an hour to show up."
l = 0
;*** show all settings - documentation; see below!
;For $x = 0 To 18
; ?"setting " + x + " = " + $TSCFG.QueryUserConfig($x)
;Next
; --- Example Code and settings you can use..
;*** change a few settings:
;$TSCFG.SetUserConfig $WTSUserConfigWorkingDirectory , "c:\workdir"
;$TSCFG.SetUserConfig $WTSUserConfigInitialProgram , "startup.exe"
;*************************************************************************
;*************************************************************************
;*** http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/tsref_9z76.a sp
;WTSUserConfigInitialProgram
;A null-terminated string containing the path of the initial program that Terminal Services
;runs when the user logs on.
;If the WTSUserConfigfInheritInitialProgram value is 1, the initial program can be any
;program specified by the client.
;WTSUserConfigfInheritInitialProgram
;WTSUserConfigfInheritInitialProgram value is 1, the initial program can be any program
;specified by the client.
;WTSUserConfigWorkingDirectory
;A null-terminated string containing the path of the working directory for the initial
;program.
;WTSUserConfigfInheritInitialProgram
;A value that indicates whether the client can specify the initial program. Value Meaning
;0 The client cannot specify the initial program. The WTSUserConfigInitialProgram string
;indicates the initial program. If you specify a user's initial program, that's the only
;program they can run; terminal server logs off the user when the user exits that program.
;1 The client can specify the initial program.
;WTSUserConfigfAllowLogonTerminalServer
;A value that indicates whether the user account is permitted to log on to a terminal server.
;Value Meaning
;0 The user cannot logon.
;1 The user can logon.
;WTSUserConfigTimeoutSettingsConnections
;A DWORD value that specifies the maximum connection duration, in milliseconds. One minute
;before the connection timeout interval expires, the user is notified of the pending
;disconnection. The user's session is disconnected or terminated depending on the
;WTSUserConfigBrokenTimeoutSettings value. Every time the user logs on, the timer is reset.
;A value of zero indicates the connection timer is disabled.
;WTSUserConfigTimeoutSettingsDisconnections
;A DWORD value that specifies the maximum duration, in milliseconds, that a terminal
;server retains a disconnected session before the logon is terminated. A value of zero
;indicates the disconnection timer is disabled.
;WTSUserConfigTimeoutSettingsIdle
;A DWORD value that specifies the maximum idle time, in milliseconds. If there is no
;keyboard or mouse activity for the specified interval, the user's session is disconnected
;or terminated depending on the WTSUserConfigBrokenTimeoutSettings value. A value of zero
;indicates the idle timer is disabled.
;WTSUserConfigfDeviceClientDrives
;Citrix ICA clients: A value that indicates whether the terminal server automatically
;reestablishes client drive mappings at logon. Value Meaning
;0 The server does not automatically connect to previously mapped client drives.
;1 The server automatically connects to previously mapped client drives at logon.
;WTSUserConfigfDeviceClientPrinters
;RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the terminal server
;automatically reestablishes client printer mappings at logon. Value Meaning
;0 The server does not automatically connect to previously mapped client printers.
;1 The server automatically connects to previously mapped client printers at logon.
;WTSUserConfigfDeviceClientDefaultPrinter
;RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the client printer
;is the default printer. Value Meaning
;0 The client printer is not the default printer.
;1 The client printer is the default printer.
;WTSUserConfigBrokenTimeoutSettings
;A value that indicates what happens when the connection or idle timers expire or when a
;connection is lost due to a connection error. Value Meaning
;0 The session is disconnected.
;1 The session is terminated.
;WTSUserConfigReconnectSettings
;A value that indicates how a disconnected session for this user can be reconnected.
;Value Meaning
;0 The user can log on to any client computer to reconnect to a disconnected session.
;Note that sessions started at clients other than the system console cannot be connected
;to the system console, and sessions started at the system console cannot be disconnected.
;1 The user can reconnect to a disconnected session by logging on to the client computer
;used to establish the disconnected session. If the user logs on from a different client
;computer, the user gets a new logon session.
;WTSUserConfigModemCallbackSettings
;Citrix ICA clients: A value that indicates the configuration for dialup connections in which
;the terminal server hangs up and then calls back the client to establish the connection.
;Value Meaning
;0 Callback connections are disabled.
;1 The server prompts the user to enter a phone number and calls the user back at that phone
;number. You can use the WTSUserConfigModemCallbackPhoneNumber value to specify a default
;phone number.
;2 The server automatically calls the user back at the phone number specified by the
;WTSUserConfigModemCallbackPhoneNumber value.
;WTSUserConfigModemCallbackPhoneNumber
;Citrix ICA clients: A null-terminated string containing the phone number to use for callback
;connections.
;WTSUserConfigShadowingSettings
;RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the user session can
;be shadowed. Shadowing allows a user to remotely monitor the on-screen operations of another user.
;Value Meaning
;0 Disable
;1 Enable input, notify
;2 Enable input, no notify
;3 Enable no input, notify
;4 Enable no input, no notify
;WTSUserConfigTerminalServerProfilePath
;A null-terminated string containing the path of the user's profile for terminal server logon.
;The directory the path identifies must be created manually, and must exist prior to the logon.
;WTSSetUserConfig will not create the directory if it does not already exist.
;WTSUserConfigTerminalServerHomeDir
;A null-terminated string containing the path of the user's home directory for terminal server
;logon. This string can specify a local path or a UNC path (\\machine\share\path). See
;WTSUserConfigfTerminalServerRemoteHomeDir.
;WTSUserConfigTerminalServerHomeDirDrive
;A null-terminated string containing a drive specification (a drive letter followed by a colon)
;to which the UNC path specified in the WTSUserConfigTerminalServerHomeDir string is mapped.
;See WTSUserConfigfTerminalServerRemoteHomeDir.
;WTSUserConfigfTerminalServerRemoteHomeDir
;A value that indicates whether the user's home directory for terminal server logon is a local
;path or a mapped drive letter. Note that this value cannot be used with WTSSetUserConfig.
;Value Meaning
;0 The WTSUserConfigTerminalServerHomeDir string contains the local path of the user's terminal
;server logon home directory.
;1 The WTSUserConfigTerminalServerHomeDir string contains the UNC path of the user's terminal
;server logon home directory, and the WTSUserConfigTerminalServerHomeDirDrive string contains
;a drive letter to which the UNC path is mapped.