SCCM behaviour as SYSTEM or USER

How does the toolkit behave when an app is deployed through SCCM?
The script will be run in system context, will that mean all the built-in env variables will be set as system as well?

for example when testing:

whoami #nt authority\system

[String]$envUserMyDocuments = [Environment]::GetFolderPath('MyDocuments') #nothing
[String]$envLocalAppData = [Environment]::GetFolderPath('LocalApplicationData') #C:\WINDOWS\system32\config\systemprofile\AppData\Local
[String]$envAllUsersProfile = $env:ALLUSERSPROFILE #C:\ProgramData
[String]$envAppData = [Environment]::GetFolderPath('ApplicationData') #C:\WINDOWS\system32\config\systemprofile\AppData\Roaming
[String]$envUserDesktop = [Environment]::GetFolderPath('DesktopDirectory') #nothing
[String]$envAllUsersProfile = $env:ALLUSERSPROFILE #C:\ProgramData
[String]$envCommonDocuments = $envShellFolders | Select-Object -ExpandProperty 'Common Documents' -ErrorAction 'SilentlyContinue' #nothing

if so, how should you access all profile folders regardless if an user is logged on?

If you want to add/change file in each user’s profile, then you need to run PSADT in the SYSTEM context.

If you need to read each user’s Environment variables, then you will need ActiveSetup to do that.
Active setup is a way to trigger a script or an EXE when the user logs on. PSADT can setup your standalone script or EXE to be triggered by ActiveSetup.

BTW: There are 3 different ways to do changes in user profiles: Installing in user profiles - ActiveSetup vs. Execute-ProcessAsUser