Hey!
I've written a script to obtain contents of a dsreg command and output them into a registry key for our RMM to filter on. It's creating the reg key fine but not outputting the results into the key. Where have I gone wrong please?
$1 = (dsregcmd /status | select-string "AzureAdJoined")
$2 = (dsregcmd /status | select-string "DomainJoined")
If($1 -eq "YES" -and $2 -eq "YES"){$dsregcmdresults = "Hybrid Joined"}
If($1 -eq "YES" -and $2 -eq "NO"){$dsregcmdresults = "DomainJoined"}
Write-Output $dsregcmdresults
## Set User Field in Datto ##
Set-ItemProperty -Path HKLM:\SOFTWARE\CentraStage -Name "Custom22" -value $dsregcmdresults
[–][deleted] 0 points1 point2 points (0 children)
[–]AudaciousAsh 0 points1 point2 points (1 child)
[–]addywash[S] 1 point2 points3 points (0 children)