question

BoopathiSubramaniam-6294 avatar image
0 Votes"
BoopathiSubramaniam-6294 asked saldana-msft edited

Setting Discovery Error 0x80070001 | Configuraiton Item

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-server-powershellmem-cm-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered BoopathiSubramaniam-6294 commented

Hi, @BoopathiSubramaniam-6294
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.





4.jpg (25.1 KiB)
1.jpg (64.7 KiB)
2.jpg (41.1 KiB)
3.jpg (103.7 KiB)
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AllenLiu-MSFT

Thank you.


I corrected the script as per your update. Powershell is updated as Bypass in Client actions. I think the issue is something blocks to execute the powershell script.
I am still getting the same message.141801-2.jpg


Please help to find what is blocking to run the powershell script from SCCM Configuration Item

Below is the powersehll policy141729-3.jpg


0 Votes 0 ·
2.jpg (55.8 KiB)
3.jpg (30.8 KiB)
AllenLiu-MSFT avatar image AllenLiu-MSFT BoopathiSubramaniam-6294 ·

You may try to change the machine policy from AllSigned to Undefined.

This thread might give more details:
https://www.reddit.com/r/SCCM/comments/c3h5em/unexpected_behavior_with_client_settings/

1 Vote 1 ·

Hello @AllenLiu-MSFT

Thanks for the articles. I found that "Allow only Signed Script" settings enabled in GPO.


142090-capture.jpg
Which policy is required to run the PowerShell scripts from SCCM ? [ "Allow local scripts or remote signed scripts" or "Allow All Scripts"


0 Votes 0 ·
capture.jpg (42.8 KiB)
Show more comments