You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep stumbling on reading the registry via an Intune Script.
I have tried the registry path with: Registry::HKEY_LOCAL_MACHINE\SOFTWARE...
Registry::HKLM\SOFTWARE...
HKLM:SOFTWARE.....
HKLM:\SOFTWARE....
This is my command, which works fine from PowerShell:
Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot -Name 'DeploymentProfileName' | Select-Object 'DeploymentProfileName' -ExpandProperty 'DeploymentProfileName'
Intune Log records the fail as:
<![LOG[[PowerShell] Fail, the details are {"Version":1,"SigningCode":649,"SigningMsg":"(Success) AccountId:00fa6d33-858d-4d5b-9ed2-80dfca1b527b,PolicyId:d5043367-ae81-4ec1-b8c7-684d6d62045d,Type:1,Enforce: Enforcement2. OSVersion:10.0.22621,AgentVersion:1.60.206.0. ","ExecutionMsg":"Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot' because it does not \r\nexist.\r\nAt C:\Program Files (x86)\Microsoft Intune Management \r\nExtension\Policies\Scripts\c9e33b9e-6140-4340-ba29-42028da8c153_d5043367-ae81-4ec1-b8c7-684d6d62045d.ps1:12 char:20\r\n+ ... lotConfig = Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Provision ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\...stics\AutoPilot:String) [Get-ItemProperty], ItemNotFo \r\n undException\r\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\r\n \r\n\r\n"}]LOG]!><time="10:15:26.0134720" date="11-24-2022" component="IntuneManagementExtension" context="" type="3" thread="85" file="">
The text was updated successfully, but these errors were encountered:
Hi,
I keep stumbling on reading the registry via an Intune Script.
I have tried the registry path with:
Registry::HKEY_LOCAL_MACHINE\SOFTWARE...
Registry::HKLM\SOFTWARE...
HKLM:SOFTWARE.....
HKLM:\SOFTWARE....
This is my command, which works fine from PowerShell:
Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot -Name 'DeploymentProfileName' | Select-Object 'DeploymentProfileName' -ExpandProperty 'DeploymentProfileName'
Intune Log records the fail as:
<![LOG[[PowerShell] Fail, the details are {"Version":1,"SigningCode":649,"SigningMsg":"(Success) AccountId:00fa6d33-858d-4d5b-9ed2-80dfca1b527b,PolicyId:d5043367-ae81-4ec1-b8c7-684d6d62045d,Type:1,Enforce: Enforcement2. OSVersion:10.0.22621,AgentVersion:1.60.206.0. ","ExecutionMsg":"Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot' because it does not \r\nexist.\r\nAt C:\Program Files (x86)\Microsoft Intune Management \r\nExtension\Policies\Scripts\c9e33b9e-6140-4340-ba29-42028da8c153_d5043367-ae81-4ec1-b8c7-684d6d62045d.ps1:12 char:20\r\n+ ... lotConfig = Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Provision ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\...stics\AutoPilot:String) [Get-ItemProperty], ItemNotFo \r\n undException\r\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\r\n \r\n\r\n"}]LOG]!><time="10:15:26.0134720" date="11-24-2022" component="IntuneManagementExtension" context="" type="3" thread="85" file="">
The text was updated successfully, but these errors were encountered: