"Environ" comes from pre-defined named symbols currently created by the Windows Login process. They are a hold-over from the days of MS-DOS, which used them as a way to identify things like a device or path search string (a list of folders to search for programs). However, those environment symbols are not always protected from user modification. That, too, is a hold-over from DOS. A user in a less controlled domain could "spoof" a "username" or "computername" symbol. Getting the info from Active Directory calls is more stringent because AD login information is read-only even in a loosely managed domain.