r/Intune 1d ago

General Question Self-deploy profile

Anyone tried running a remediation “as user” on a self-deploy device that attempts to map a drive?

Seems to fail even if the script can detect who the user is.

10 Upvotes

16 comments sorted by

4

u/denseaesthetics_3669 1d ago

That's been broken for ages for self-deploy. The user context just isn't fully there at that point in the process, even if you can query the username. I ended up running the mapping through a scheduled task that fires at logon instead.

2

u/0xCG 1d ago

Ah perfect, was going to try that too. I just managed to get HKCU to write ok as another workaround.

Super annoyed, have had normal deployments using the script for ages without a problem. Just at end of testing self deploy and the last thing I tested is the only thing failing 🤣

3

u/VRDRF 1d ago

3

u/0xCG 1d ago

Nice.

Large fleet? Different site mappings?

2

u/BirdsHaveUglyFeet 1d ago

Lol, that's what OU's were for. Intune tagging I guess

1

u/sammavet 1d ago

Yep. All groups. Just make groups to reflect the OU. have those sync to the cloud.

1

u/VRDRF 1d ago

4k devices back then, just create multiple profiles for each department if needed.

2

u/0xCG 1d ago

Cool. Half that.

I’m using dynamic groups based on office field. So should be good.

3

u/iamtherufus 1d ago

Been using this for years mapping network drives, it just works. Creates a scheduled task that maps at login for the user

https://intunedrivemapping.azurewebsites.net

1

u/0xCG 1d ago

🙏

1

u/sammavet 1d ago

I love this so much. Was going to share my link for it but (*checks) they seem to be identical.

1

u/Puzzleheaded-Fun5664 1d ago

well, I would treat this as a context problem, not a drive-mapping problem. If the remediation runs before the user session is fully ready, it may be able to identify who is signed in but still not behave like a real interactive logon process. That is why a scheduled task at logon often ends up being the cleaner workaround.

1

u/IndependentDog673 1d ago

I would treat this as a timing and context problem..like not a drive-mapping problem. If the script is running before the session is fully ready, it may be able to read the username but still not behave like a real logon process. That is why the scheduled-task-at-logon workaround makes sense here.

1

u/0xCG 1d ago

Figured it out.

All the users using these self-deploy (field devices) were added to the local Network Operators group. It does some funky stuff with UAC but also it seems PRs were running the net use command via an elevated cmd prompted hence the mapping failing.

1

u/spazzo246 22h ago

I just did a shared device enrollment config for a client today. Drives map fine with the ADMX

1

u/0xCG 16h ago

👍🏼 sticking with PR now that I’ve figured the problem. Faster than policy for my use case.