I see the problem.

GroupAdd() uses the WinNT naming convention, and can not handle a ADSI object passed to it. you need to pass the name of an object, one that you can use in the WinNT:\\ naming convention.

Also i am a little confused on what you are trying to add to what group? I am guessing that you are wanting to add users to the "Internet Mail Denied" group if they are not a member of the "Internet Mail Access is enabled" group, is this correct?

i think the syntax for groupadd() you are wanting is... (untested)

groupadd(@domain,"Internet Mail Denied",split($account,"CN=")[1])