So, I've reviewed as much documentation as I can about InTune and NSIS and I can't seem to figure this out.
I have an NSIS silent installer that (when executed locally, even as system via psexec) runs without any issue at all but seems to do nothing when deployed with software deployment with InTune. The installer calls a batch file that runs a vbscript to enumerate all the users on a system then changes all their passwords: See below for source on all of the abovementioned.
NSIS Installer
Name "Silent"
OutFile "silent.exe"
RequestExecutionLevel admin
Function .onInit
SetSilent silent
FunctionEnd
Section ""
File FindUsers.vbs
File un.bat
Exec un.bat
SectionEnd
VBS Script
Set exclude = CreateObject("Scripting.Dictionary")
exclude.CompareMode = vbTextCompare
exclude.Add "HomeGroupUser$", True
exclude.Add "Guest", True
Set accounts = GetObject("WinNT://.")
accounts.Filter = Array("user")
For Each user In accounts
If Not exclude.Exists(user.Name) Then WScript.Echo user.Name
Next
And lastly the batch file:
@echo off
setlocal
set newpw=Test
for /f "delims=" %%u in ('cscript //NoLogo FindUsers.vbs') do (
echo "net user "%%u" "%newpw%""
net user "%%u" "%newpw%"
)
Why wouldn't this run properly when deployed with intune but would run properly when executed as a user or as system?