Issues Running Wi-Fi Profile Script via Intune

0
11
Asked By CuriousCactus42 On

I'm trying to run a PowerShell script to create a managed Wi-Fi profile (WPA3), and while it works fine on clients, I'm hitting errors when I try to execute it through Intune. I've looked at the logs and noticed that there are spaces in the registry key, which might be causing issues. The script runs in system context and I've attempted it in both 32-bit and 64-bit modes. Any advice on how to troubleshoot or fix this?

5 Answers

Answered By HelpfulHank73 On

It’s not a direct fix, but you might want to clean up your script a bit. You are fetching the interface profiles multiple times with Get-ChildItem, which is inefficient. Consider storing the results in a variable to simplify your loops. Also, check how you're constructing the registry path; it looks like it might be built incorrectly.

QuickFix97 -

Definitely! Keep an eye on spaces and special characters in your registry paths. A slight mismatch can lead to those 'path not found' errors you're experiencing. Simplifying the code can really help in tracking down the root cause!

SmartScripter45 -

Good point! Adding logging within your script while running it in Intune might also help you catch where things are going wrong during execution.

Answered By TechieTina99 On

Have you considered using Intune's built-in configuration profile for adding Wi-Fi instead of running a custom script? It might simplify things and avoid these errors you’re encountering.

Answered By DevDude12 On

Instead of Get-Item, have you tried using Get-ItemProperty or Get-ItemPropertyValue? It could change how you access the registry keys and help with the errors you're seeing.

Answered By ScriptMaster25 On

Remember that Intune requires you to run PowerShell in 64-bit mode, even if you start from the 32-bit path. Make sure you’re not missing that step, as it can lead to these kinds of issues.

Answered By CodeCrafter88 On

It might help to properly format your code before posting. Use your favorite PowerShell editor to highlight the code and hit tab for indentation, then copy and paste it here. This could make it easier for others to read and help you troubleshoot.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.