High CPU usage on desktops

after an additional month, i wanted to post an update… on referencing the forum & via empirical investigation/experimentation… i have successfully automated my ‘ARM system (mult cams) w/30secDelay’ & DisARM system’ scenarios via PowerShell…
HOWEVER, i believe it is not possible via WebAPI to enable/disable a ‘Source’ (camera) as part of those scripts (eg. to ‘enable’ my disabled PCweb cam). That is to say, i’m fairly confident via scripting solely via web calls, the NCS framework does not expose connect/disconnect methods as web service calls. I further point to the NCSWebUI to highlight the absence of this… namely, http://localhost:8100/#/client/source-list appears to NOT display what the Win32 UI exposes as ‘Source enabled/Online’. There are no entries in the table for sources/cameras which are ‘disabled’, whereas enabled cameras are enumerated in the table i see.

I would be happy to be corrected with an example of how to properly enable (& disable) a configured cam/video source, by anyone who can point me in the right direction. Thanks! --PapaMarc

Here are my scripts for ‘ARM system with delay’ and ‘disARM system’ for others to reference/reuse (they’re not pretty, but they work):

ARMwithDelay.ps1:
#Arms NCS with Delay on departure

$URLLogon = “http://localhost:8124/Json/Login?username=YourUNHere8password=YourPwdHere
PowerShell Invoke-WebRequest -Uri $URLLogon -Method GET

$URLListCams = “http://localhost:8124/Json/GetCameras?authToken=YourTokenHere
PowerShell Invoke-WebRequest -Uri $URLListCams -Method GET

#ideally, i would enable SourceID=3 PC Webcam here

#enable motion detector on CamN (which facilitates recording to occur on motion)
$URLCam0 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=0&enabled=true&authToken=YourTokenHere
$URLCam1 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=1&enabled=true&authToken=YourTokenHere
#$URLCam2 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=2&enabled=true&authToken=YourTokenHere
#$URLCam3 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=3&enabled=true&authToken=YourTokenHere

#verbose
#PowerShell Invoke-WebRequest -Uri $URLCam0 -Method GET

1…30 | ForEach {
Start-Sleep -s 1
Write-Progress -activity "Arming System in: " -Status (30-$_)
}

#non-verbose
Invoke-WebRequest -Uri $URLCam0
Invoke-WebRequest -Uri $URLCam1
#Invoke-WebRequest -Uri $URLCam2
#Invoke-WebRequest -Uri $URLCam3

Write-Progress -activity “System ARMED!”

DisARMSystem.ps1:
#disarms NCS upon return home

#Logon
$URLLogon = “http://localhost:8124/Json/Login?username=YourUNHere8password=YourPwdHere
PowerShell Invoke-WebRequest -Uri $URLLogon -Method GET

#List Cams
$URLListCams = “http://localhost:8124/Json/GetCameras?authToken=YourTokenHere
PowerShell Invoke-WebRequest -Uri $URLListCams -Method GET

#disables motion detector on cameras causing motion triggered recording rules to no longer fire
$URLCam0 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=0&enabled=false&authToken=YourTokenHere
$URLCam1 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=1&enabled=false&authToken=YourTokenHere
#$URLCam2 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=2&enabled=false&authToken=YourTokenHere
#$URLCam3 = “http://localhost:8124/Json/StartStopMotionDetector?sourceId=3&enabled=false&authToken=YourTokenHere

#disconnects Laptop cameras
#ideally, i’d disable SourceID=3 (laptop cam) here
#NOT working

#non-verbose
Invoke-WebRequest -Uri $URLCam0
Invoke-WebRequest -Uri $URLCam1
#Invoke-WebRequest -Uri $URLCam2

Write-Progress -activity “System disarmed”

btw, as an example by placing a shortcut for PowerShell on the desktop and setting Target:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -ExecutionPolicy RemoteSigned -File C:\Users<MyWin10UserDir>\Documents\NCSScript\Arm.ps1
I can double-click that shortcut and ARM the system w/delay. Further, if i copy the shortcut into:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs i can further ARM by saying, “Hey Cortana, open/start ARM”. To the extent you consider heading down this slippery slope, you may want to further investigate how to setup Cortana to make its best attempt to recognize and only respond to you…