I don't need this anymore as I will be changing to using different filtering groups based on proxy port number rather than digest authentication. However, I discovered something rather interesting with this particular line of coding.

If I logon as a pupil it will fill in the details for the username and password in the credentials manager in windows 7. If I logon as a manager account that is also a member of the domain admins account, the script doesn't do anything while logging on. Curiously enough the script works when I run the script manually. The script is obviously running during logon because it works for the pupils and all the other code in the main script is running. I just wonder why this code does not work on logon if you are a member of the domain admins account in addition to the managers global group.

I am not worried about it as I will no longer be using this coding after December, but I just thought that I would report it as a possible bug. I am using kixtart version 4.62

Thanks

Code in main script

 Code:
proxyauthenticate ($servername + "\profiles$\all\software\patches\proxies\", "proxyauth.ini")


Function

 Code:
Function proxyauthenticate ($Installs, $File)

$groups = "Pupils", "Students", "Staff", "OfficeAdmin", "Managers", "Visitors"
$inifile = $Installs + $File

For Each $group in $groups
	If InGroup($group)
		$proxyuser = ReadProfileString($inifile, $group, "username")
		$proxypass = ReadProfileString($inifile, $group, "password")
		$proxyserver = ReadProfileString($inifile, $group, "proxy")
$shellcmd = 'cmdkey /generic:$ProxyServer /user: $proxyuser /pass: $proxypass'
Shell $ShellCMD		
	EndIf
Next
EndFunction