|
Much appreciated, Gentlemen!
Yeah, the User Profile lock can be caused by AV, but in our environment, it can usually be traced back to sessions being open too long with too many applications running on an older image. Installing UPHClean everywhere could help, but I cringe at the thought of proposing the intiative to be implemented on the global enterprise network. Not so much because it's a bad idea, but because the corporate philosophy of "the less change the better" is so deeply entrenched.
True, it would be too optimistic to hope to catch every error. Right now I have this bit of script to try to catch any instance of the error where the script exits, instead of logging out the user:
If @PRODUCTTYPE = "Windows Server 2003 Domain Controller" OR @PRODUCTTYPE = "Windows 7 Professional Edition" OR @PRODUCTTYPE = "Windows 7 Ultimate Edition"
Open (1, "\\##########################", 4)
Writeline (1, @CRLF + @USERID + " " + @WKSTA + " " + @LDOMAIN + " " + @DATE + " " + @TIME + " " + @PRODUCTTYPE + @CRLF)
Close (1)
Exit
EndIf
Then the logout statement follows.
I got the known offenders in the test OU, where this test exit statement runs, so I figure if I can catch even a few instances of this working, and no instances of it failing, I'll have sufficient proof of concept.
I doubt the missing quote is the cause, because the failure is only on a few machines, on which the Userenv 1517 and 1524 are particularly bad, and following reboot, the script runs fine, as it does from the start on most machines. This is why I lean towards profile lock blocking @PRODUCTTYPE from reading the relevant Registry. If I get the chance, I'll definitely try out the if instr(@producttype,"unknown") - it should shed considerable light on exactly how the "unknown" value gets treated. There certainly seems to be something different about it, as an If statement that is predicated not on "unknown", but on other explicit values, nevertheless executes when it is handed the "unknown" value. Really threw me for a loop, that did. This Sanity UDF sounds great, I will definitely check it out, and the input accept script will be very handy for when more exact data gathering is required.
Thank you both,
Sergey
|