How to add a WIA scanner to scanners and camera devices while using powershell.

JR 1 Reputation point
2022-07-15T05:40:03.533+00:00

Dear MS Community,

I can't find enough information how to add a WIA scanner to scanner and camera devices. I however am able to install the INF driver using powershell, just the adding scanner part is not working out...

I look forward to your help.

Kind regards,

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 39,931 Reputation points
    2022-07-15T12:28:25.607+00:00

    Hi there,

    You can try WSD to install a WIA scanner driver .To install a WIA scanner driver with WSD, you should use the WSDScan.sys kernel-mode driver. During IRP_MN_START_DEVICE, WSDScan.sys reads the PKEY_PNPX_ID device property and saves it to the registry.

    Install a WIA scanner driver with WSD

    https://learn.microsoft.com/en-us/windows-hardware/drivers/image/installing-a-wia-scanner-driver-with-wsd

    In PowerShell you can achieve this combining the Get-PnPDevice to obtain the details and then you can use EnablePnPDevice in your Powershell scripts to add the device.

    Get-PnPDevice usage:
    https://learn.microsoft.com/en-us/powershell/module/pnpdevice/get-pnpdevice?view=windowsserver2022-ps Enable-PnPDevice

    Enable-PnPDevice usage:
    https://learn.microsoft.com/en-us/powershell/module/pnpdevice/enable-pnpdevice?view=windowsserver2022-ps

    I hope this information helps. If you have any questions please let me know and I will be glad to help you out.

    ---------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

  2. JR 1 Reputation point
    2022-07-15T12:45:00.89+00:00

    Dear Limitless,

    I tried these powershell cmdlets before, these are made for activating a disabled image/ camera device in devicemanager but not installing a device. So it does only work when the Wia scanner is already installed in Windows scanner and camera devices.

    Blockquote

    In PowerShell you can achieve this combining the Get-PnPDevice to obtain the details and then you can use EnablePnPDevice in your Powershell scripts to add the device.

    Get-PnPDevice usage:
    https://learn.microsoft.com/en-us/powershell/module/pnpdevice/get-pnpdevice?view=windowsserver2022-ps Enable-PnPDevice

    Enable-PnPDevice usage:
    https://learn.microsoft.com/en-us/powershell/module/pnpdevice/enable-pnpdevice?view=windowsserver2022-ps

    I hope this information helps. If you have any questions please let me know and I will be glad to help you out.

    Blockquote

    0 comments No comments

  3. JR 1 Reputation point
    2022-07-15T13:22:22.797+00:00

    221048-image.png

    To be more in depth, I want to do in powershell what this wizard does.

    0 comments No comments

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.