Setting Discovery Error 0x80070001 | Configuraiton Item

Boopathi S 3,816 Reputation points
2021-10-18T12:43:57.933+00:00

Hello,

I created a Configuration Item and Baseline to check whether below registry exist or not
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Teams\IsWVDEnvironment]
Type: REG_DWORD
Value: 1

I tried the below powershell commands in the Discovery Script
PowerShell Command 1 :

$UpdateCheck = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Teams' -Name IsWVDEnvironment
if (($UpdateCheck.IsWVDEnvironment –eq 1)
{Write-Host 'Compliant'}
else
{Write-Host 'Non-Compliant'}

PowerShell Command 2 :

try {
if(-NOT (Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Teams")){ return $false };
if((Get-ItemPropertyValue -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Teams' -Name 'IsWVDEnvironment' -ea SilentlyContinue) -eq 1) { } else { return $false };
}
catch { return $false }
return $true

But it returned the "Setting Discovery Error 0x80070001" in the Evaluation Report.

Please let me know what is the thing i am doing wrong. And help to solve the issue

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Intune | Configuration Manager | Other
0 comments No comments
{count} votes

Accepted answer
  1. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2021-10-19T02:32:28.157+00:00

    Hi, @Boopathi S
    Thank you for posting in Microsoft Q&A forum.

    I test your first powershell command in my lab, it works well, the only thing I changed is to remove the semi-parentheses after "if".
    141538-4.jpg

    Here is my configuration and results:
    141539-1.jpg

    141529-2.jpg

    141459-3.jpg


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.