script
4 TopicsManipulating the registry via Intune push
Our goal is simple: Manipulate the registry as part of application deployment or PowerShell script. Use case: When we install our VPN client, there are a raft of registry updates that need to be made to configure it for use in our environment. The easiest way of doing this is simply by importing a .reg file we've created. The problem that I just can't seem to overcome is how to import a .reg file using PowerShell as part of an Intune deployment. For testing purposes, I've created a simple test registry file and I'd ideally like to use a PS script that simply has the command "reg.exe import .\1Test.reg" in it. The command runs perfectly from CLI but when I try pushing it as part of a Win32 app, it fails. When I build in other diagnostic steps, everything in the script runs perfectly except for the actual import. I've tried using the script to create a temporary directory, copy the files to it, set it as the working directory, and importing from there in case there were path issues. Everything works perfectly all the way up to the actual import, which never works. I've tried using "regedit.exe /silent" as well as "reg.exe" and I've spun it off as a separate process; nothing seems to work. I think it needs to run in the user instead of system context so I've tried both of those. I'm currently at a 100% failure in my ability to figure this out and I'm hoping that someone out there in the community has dealt with this and knows the incredibly simple secret and can demystify it for me. Thanks in advance for your help!141KViews0likes11CommentsIntune installed desktop shortcut needs to be removed
Icreated a desktop shortcut via intune windows app (win 32). Here is my script New-Item -Path "c:" -Name "mem" -ItemType "directory" -Force Copy-Item "S:\Shortcuts\UKG.ico" -Destination "c:\mem\UKG.ico" $Shell = New-Object -ComObject ("WScript.Shell") $ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG.lnk") $ShortCut.TargetPath="-------------------------------------" $Shortcut.Arguments="------------------------------------" $ShortCut.IconLocation = "c:\mem\UKG.ico"; $ShortCut.Description = "UKG Shortcut"; $ShortCut.Save() (I replaced the path with ————————) The app works fine and copies the ico file from a network share and places it on the c drive in a folder it creates named mem. Now after creating the shortcut they have decided to use SSO which is a new address. I need to delete the ico file in the mem folder and remove the desktop shortcut. I created a simple script. $ShortcutFile = "$env:Public\Desktop\UKG.lnk" if (Test-Path $ShortcutFile){ Remove-Item $ShortcutFile } else { Write-Output "Shortcut Not Found" } To just delete the shortcut. When I run the script as an admin in powershell it works just fine. If I try and run the script in a normal powershell it fails and says it doesn't have access to the public desktop. I ran the file in Intune as just a script and it fails. I converted it to an intunewin file and added it as an intune windows app (win 32). It successfuly runs on all my pcs but does not remove the icon. I'm at a loss and I really need to remove this icon so I can push the new one. Any suggestions on how to remove it via a script or app? I've checked into remediation scripts but that isn't going to be an option for now.Solved5.1KViews0likes23CommentsGIA - Get Intune Assignments Application
Hello Everyone, Some time ago I was struggling to get all Assignments Intune for a Specific Azure AD Group. This option does not exist at console, and we need to run a lot of queries at MS Graph and/or use PowerShell to retrieve. So, to help the community I started to create PowerShell scripts to help to query some of the Assignments but, still, I had a lot of scripts each one to retrieve a specific type of items (like profiles, conditional access, apps, etc). After a while I decide to develop a C# .NET Application to facilitate the process. Today I want to share with all you my GIA App (Get Intune Assignments). It's available on my gitHub page: sibranda/GetIntuneAssignments: Get Intune Assignments helps you to identify the Intune assignments target the Azure AD Groups (github.com) I hope this app can help you guys the same way is helping me and my customers. Regards4KViews3likes1CommentIntune Scripting
Hello I am trying to integrate Intune with other cloud platforms, Is it possible to create Scheduled Jobs Scripts in any language, for example Powershell. Then in this Scheduled Job Powershell script, we need to consume external REST APIs that belong to platforms like ServiceNow. Is this possible at the Intune platform? Thanks! Jesus2.3KViews0likes2Comments