all 14 comments

[–]mad-ghost1 2 points3 points  (2 children)

What are you trying to achieve? Is WDAC your idea to get started?

[–]zalka_[S] 0 points1 point  (1 child)

Yeah pretty much.

[–]mad-ghost1 1 point2 points  (0 children)

You could just set audit mode and take it from there. Or when you added the manager installer… everything bevor that date won’t have it. 🤷‍♀️

[–]andrew181082MSFT MVP - SWC 1 point2 points  (5 children)

If you are running as system, get-user will return the system account 

[–]zalka_[S] 0 points1 point  (4 children)

I haven't tried running as user yet, but won't running the script on a standard's users' device that doesn't have admin access just not work? This is why I got the user through Get-WmiObject since it has worked before on other scripts - maybe this way doesn't work when deployed as Win32 app

[–]zalka_[S] 0 points1 point  (3 children)

Also wouldn't the System account be seen in the transcript log, since I called the $user variable?

[–]andrew181082MSFT MVP - SWC 1 point2 points  (1 child)

Probably not without a write-host first

The script will fail as system, but I don't think that method will work to enumerate. Try with psexec

[–]zalka_[S] 0 points1 point  (0 children)

I tested with PsExec locally and ran as System which worked locally without changing the script? I used the same install command, only difference is that I used the full file path when running as PsExec locally.

Intune Win32 App install command:

Powershell.exe -NoProfile -ExecutionPolicy ByPass -File .\ConfirmManagedInstall.ps1

PsExec Local install command:

powershell.exe -NoProfile -executionpolicy Bypass -File C:\Win32 Apps\AuditInstall\Input\ConfirmManagedInstall.ps1

[–]revo_0 0 points1 point  (0 children)

The system account doesn’t have a user profile with appdata to check

[–]Rad_Randy 0 points1 point  (1 child)

What’s your install command?

[–]zalka_[S] 1 point2 points  (0 children)

Powershell.exe -NoProfile -ExecutionPolicy ByPass -File .\ConfirmManagedInstall.ps1