Hi, I’m domain admin, and recently, I have created new COMPUTER env.var. under “Default Domain Policy” GPO.
Image may be NSFW.
Clik here to view.
That env.var now can be found on every domain computer in the following registry path: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” as expected.
In powershell, I can read that env.var. quite easily:
PS C:\> gc Env:\dnbsmtpsrv
DNBMAIL01.kmbdom.int
Problem is, that command, in task scheduler script, doesn’t work IF task is running under NT AUTHORITY\SYSTEM built in account! It doesn’t make any error ($Error is empty), it simply return $null.
Same problem is present on: Windows 7, Windows Server 2012. Both PS version is 3.0
Please, help me! TNX!