Share via


Ooooh... PnP Cmdlets & Surface Book Fun!

PowerShell just gives and gives and gives.

Whilst looking for automated UEFI management options for my Surface Book, I came across the PnPDevice cmdlets.

surface-book-hero

Time for a play!

Some code to software-disable some of the numerous cameras that come with the shiny, shiny Surface Book:

 
        $IntelCam = Get-PnpDevice -Class MEDIA -FriendlyName "Intel(R) AVStream Camera 2500"
        Disable-PnpDevice -InputObject $IntelCam -Confirm:$false -PassThru
        `
        $FrontCam = Get-PnpDevice -Class System -FriendlyName "Microsoft Camera Front"
        Disable-PnpDevice -InputObject $FrontCam -Confirm:$false -PassThru

        $FrontIrCam = Get-PnpDevice -Class System -FriendlyName "Microsoft IR Camera Front"
        Disable-PnpDevice -InputObject $FrontIrCam -Confirm:$false -PassThru

        $SurfaceCam = Get-PnpDevice -Class System -FriendlyName "Surface Camera Windows Hello"
        Disable-PnpDevice -InputObject $SurfaceCam -Confirm:$false -PassThru

Now I need to reboot, so best do a one-time suspension of Bitlocker first

 
        Suspend-BitLocker -MountPoint "C:" -RebootCount 1
        Restart-Computer

 

No more front cameras.

Windows Hello rocks, though, so let's turn those camera's back on:

 
        $IntelCam = Get-PnpDevice -Class MEDIA -FriendlyName "Intel(R) AVStream Camera 2500"
        Enable-PnpDevice -InputObject $IntelCam -Confirm:$false -PassThru

        $FrontCam = Get-PnpDevice -Class System -FriendlyName "Microsoft Camera Front"
        Enable-PnpDevice -InputObject $FrontCam -Confirm:$false -PassThru

        $FrontIrCam = Get-PnpDevice -Class System -FriendlyName "Microsoft IR Camera Front"
        Enable-PnpDevice -InputObject $FrontIrCam -Confirm:$false -PassThru

        $SurfaceCam = Get-PnpDevice -Class System -FriendlyName "Surface Camera Windows Hello"
        Enable-PnpDevice -InputObject $SurfaceCam -Confirm:$false -PassThru

        Suspend-BitLocker -MountPoint "C:" -RebootCount 1
        Restart-Computer

 

Use PnPDevice cmdlets to explore your hardware! Go on. What's the worse that could happen?!

 


 

Between writing this post and publishing it, the following has been released:

Microsoft Surface Enterprise Management Mode

 

Now, I'm obliged to try and find some time to play with SEMM!