Hi Michael,
You have a couple of fundamental issues as I see it.
You can't have the value in the comment field equal to two different queries UNLESS both of those queries contain the same data.
Also you can not use CASE 1 twice in a SELECT statement. A SELECT statement only looks for the the first occurance and then does what it's instructed to do. If nothing is a match then it will do what CASE 1 tells it to do, sort of a fall back to do something if no match is found.
Do you want the @USERID or the @FULLNAME to match @WKSTA
Here is an example of setting the comment to the user's ID if you want it to be something else then change what it's looking for.
Code:
Break On
Dim $RC,$Exists,$Update
$RC=SetOption('Explicit','On')
$RC=SetOption('NoVarsInStrings','On')
$Exists = ReadValue('HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','srvcomment')
If LCase(@UserID) <> $exists
$Update = WriteValue('HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','srvcomment',LCase(@UserID),'REG_SZ')
EndIf
You need to supply more accurate information if this is not what you're looking for so that we can better help you.