There were a few problems with your XML configuration at the top of the script.
- In the
AllowedApps
element at the top, you had some of the App
elements with an attribute of ExecutableName
. This attribute should be named AppUserModelId
, like the App
elements in my example.
- For classic Windows apps (Chrome, Microsoft Office, etc.), you don't put
!App
at the end of the path.
- After the very last item in the pinned Start menu items list, you had a comma. You don't need a comma after the last item.
Oh, one other thing. Not sure it matters, but when I paste the code/script into PowerShell ISE, the run button remains greyed out. I have to hit enter on the keyboard to get any script to run.
Sounds like you are pasting the code into the blue PowerShell console at the bottom of the ISE, rather than opening the file I posted and you modified. I had said, "
Open the file I posted, make adjustments to the user account name and the programs list, and then hit the Play button in the toolbar to run it."
Also, in the Microsoft article I linked in
#18, it says to open PowerShell using PSExec. You would have to open PowerShell ISE the same way. It sounds like you're not doing that, given the errors you posted. The command for that would be
powershell_ise.exe
, rather than
powershell.exe
.
Not trying to be a jerk here, but with all of the above stuff, plus the introduction of "Set-AssignedAccessConfiguration," which ChatGPT didn't say, at least in what you posted here, it sounds like directions are not being followed. I don't say that to be mean, but it's very important that directions are followed with this stuff. The XML has to comply with the expected format, and Microsoft's and my instructions have to be followed. If you're not sure about something, just ask.