Updating so environment agnostic

Needed to use the appName variable for setting windows authentication
properties for kernel mode etc.