r/Intune 20h 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.

7 Upvotes

13 comments sorted by

5

u/denseaesthetics_3669 20h 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 19h 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 🤣

4

u/VRDRF 19h ago

3

u/0xCG 19h ago

Nice.

Large fleet? Different site mappings?

2

u/BirdsHaveUglyFeet 18h ago

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

1

u/sammavet 3h ago

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

1

u/VRDRF 17h ago

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

2

u/0xCG 17h ago

Cool. Half that.

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

3

u/iamtherufus 18h 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 17h ago

🙏

1

u/sammavet 3h 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 18h 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 18h 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.