scripts
5 TopicsTurn on Memory Integrity via Intune
Hi, I want to turn on Memory Integrity via Intune. I used the following script to turn on Memory Integrity, but it didn't. Also, there are no errors or failure statuses on the Intune Scripts Status page. Could someone please suggest This is the script I used: # Registry key path $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" # Desired value for Memory Integrity (1 for enabled with UEFI lock) $desiredValue = 1 # Initialize exit code $exitCode = 0 # 0 indicates success by convention try { # Check if the key exists if (Test-Path -Path $registryPath) { $currentValue = Get-ItemProperty -Path $registryPath | Select-Object -ExpandProperty "Enabled" # Check if the value is already set to the desired value if ($currentValue -eq $desiredValue) { Write-Host "Memory Integrity is already enabled with UEFI lock. No changes made." } else { # If the key exists but the value is not as desired, set it to the desired value Set-ItemProperty -Path $registryPath -Name "Enabled" -Value $desiredValue Write-Host "Memory Integrity enabled with UEFI lock successfully." } } else { # If the key does not exist, create it and set it to the desired value New-Item -Path $registryPath -Force Set-ItemProperty -Path $registryPath -Name "Enabled" -Value $desiredValue Write-Host "Memory Integrity enabled with UEFI lock successfully." } } catch { Write-Host "An error occurred: $_" $exitCode = 1 # 1 indicates failure } # Exit with the specified exit code exit $exitCode Output of the regedit: Enabled : 1 PSPath : Microsoft.PowerShell.Core\Registry::\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity PSParentPath : Microsoft.PowerShell.Core\Registry::\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios PSChildName : HypervisorEnforcedCodeIntegrity PSProvider : Microsoft.PowerShell.Core\Registry4KViews0likes7CommentsScript status showing failed however, the desktop Icon is installed. Deployed script via Intune
I have the following script deployed in Intune. The script is working fine- it is deploying the desktop icon that I want. But the issue is even though the desktop icon is there- it is still showing as status failed in Intune status page #Variables creating local folder and download .ico file $LocalIconFolderPath = "C:\Intune\Xxxxxxxxxxxxxxx" $SourceIcon = "https://xxxxxxxx/xxxxxxxxlogo-wo-wb/xxxxxxxxlogo-wo-wb.ico" $DestinationIcon = "C:\Intune\Xxxxxxxxxxxxxxx\xxxxxxxxlogo-wo-wb.ico" #Step 1 - Create a folder to place the URL icon New-Item $LocalIconFolderPath -Type Directory #Step 2 - Download a ICO file from a website into previous created folder curl $SourceIcon -o $DestinationIcon #Step 3 - Add the custom URL shortcut to your Desktop with custom icon $new_object = New-Object -ComObject WScript.Shell $destination = $new_object.SpecialFolders.Item('AllUsersDesktop') $source_path = Join-Path -Path $destination -ChildPath '\\Global Intranet.lnk' $source = $new_object.CreateShortcut($source_path) $source.TargetPath = 'https://xxxxxxxxxxxxx.sharepoint.com/sites/GlobalIntranet?web=1' $source.IconLocation = ”C:\Intune\Xxxxxxxxxxxxxxx\xxxxxxxxlogo-wo-wb.ico” $source.Save()Solved1.6KViews0likes7CommentsScripts don't working in mac?
Hello, I´m new to deploying scripts on intune, I'm testing a sh script that downloads a zip file, and then unzips in another location the problem is that on Intune it says that it is deployed correctly but it doesn't do anything. #!/bin/sh curl -L -o "$HOME/Desktop/Gradle.zip" "https://services.gradle.org/distributions/gradle-8.1-all.zip" --insecure mkdir -p /opt/gradle unzip -q -d /opt/gradle "$HOME/Desktop/Gradle.zip" export PATH="/opt/gradle/gradle-8.1/bin:$PATH This is the code, if I run it manually it works.Solved1.1KViews0likes2CommentsUnable to deploy PowerShell scripts to a newly co-managed device with Intune
Hi there, I am having issues deploying a PowerShell script through Intune to a device that has recently become co-managed with Configuration Manager. The CCM client was successfully installed and uses a CMG when off-network. The user logs into the device with a local admin account not a domain account. This MS guide states that the Client Apps workload in ConfigMgr doesn't need to be switched to Intune for PowerShell scripts when running on Windows 10 clients newer than 1903. But in case, I have moved the Client Apps workload to Pilot Intune with a device collection containing my device. Intune acknowledges this and displays the correct Intune Managed Workloads on the device overview screen. Even with this switched, I noticed the issue also impacts Win32 and LoB applications too. I cannot get any new applications to push down to the device anymore (since becoming co-managed) despite the workload supposedly being managed by Intune. The other workloads such as Device Configuration can be correctly controlled with Intune as tested with several configuration policies. Running the same script manually on the device worked as expected. Pushing the script to a separate device that isn't co-managed, only AADJ, also worked as expected. I've also tried targeting the script to a user security group instead of a device based group to no avail. I would appreciate any help on this. Best EthanSolved3.3KViews0likes2CommentsPowershell Script behaviour - User Context
I have an issue with a specific application that requires each user logon to have registration data for the app in their current user key location. The issue I have is that the system is in KIOSK mode and therefore only applications that are whitelisted are allowed to run. If I whitelist the powershell application I can successfully run the script adding the required values to the registry. In doing this however it presents a tile on the KIOSK setup. Question! How do I allow the use of powershell without presenting a tile? To clarify this doesn't appear to work using the scripts facility on Intune endpoint manager setting the script to user context mode. If I review the AppLocker log following an attempt I can see powershell is blocked. Any assistance with this would be much appreciated. Regards, Jon Mason3.8KViews0likes1Comment