Windows Vista Forums

workstation customizations via PowerShell scripts

  1. #1


    Larry__Weiss Guest

    workstation customizations via PowerShell scripts

    I'd like to write a PowerShell script to set certain Windows customizations when
    setting up a new workstation.

    Take for example a mouse setting that enables the Pointer Option named "Snap To"
    (usually setup via a Control Panel accessed Mouse Properties via a checkbox).
    How would I write a PowerShell command to turn that setting on? Or even better,
    how would I do research to learn what how to do that (other than just asking here) ?

    I thought I'd start out with that particular need, and see if I could see a
    pattern to do some other customizations.

    - Larry



      My System SpecsSystem Spec

  2. #2


    Marco Shaw [MVP] Guest

    Re: workstation customizations via PowerShell scripts

    You will certainly need to invoke some non-PowerShell magic... It could be
    that you'll find plain-old command line options or you may have to make
    Win32 or P/Invoke calls.

    In other customizations, you may find registry settings you can do in
    PowerShell though.

    Worst case, you can always automate mouse-clicks. .NET has some key stroke
    automation, but I understand using www.autoitscript.com and it's COM
    interface is more flexible.

    Marco

    "Larry__Weiss" <lfw@newsgroup> wrote in message
    news:#OimuYpVKHA.2340@newsgroup

    > I'd like to write a PowerShell script to set certain Windows
    > customizations when setting up a new workstation.
    >
    > Take for example a mouse setting that enables the Pointer Option named
    > "Snap To" (usually setup via a Control Panel accessed Mouse Properties via
    > a checkbox).
    > How would I write a PowerShell command to turn that setting on? Or even
    > better, how would I do research to learn what how to do that (other than
    > just asking here) ?
    >
    > I thought I'd start out with that particular need, and see if I could see
    > a pattern to do some other customizations.
    >
    > - Larry

      My System SpecsSystem Spec

  3. #3


    Karl Mitschke Guest

    Re: workstation customizations via PowerShell scripts

    Hello Larry__Weiss,

    > I'd like to write a PowerShell script to set certain Windows
    > customizations when setting up a new workstation.
    >
    > Take for example a mouse setting that enables the Pointer Option named
    > "Snap To"
    > (usually setup via a Control Panel accessed Mouse Properties via a
    > checkbox).
    > How would I write a PowerShell command to turn that setting on? Or
    > even better,
    > how would I do research to learn what how to do that (other than just
    > asking here) ?
    > I thought I'd start out with that particular need, and see if I could
    > see a pattern to do some other customizations.
    >
    > - Larry
    >
    You might be able to do this using WMI.

    Look to the Win32_PointingDevice class

    I do not know that you will find twhat you are looking for, but it's a start.

    Karl



      My System SpecsSystem Spec

  4. #4


    Larry__Weiss Guest

    Re: workstation customizations via PowerShell scripts

    Karl Mitschke wrote:

    > Hello Larry__Weiss,

    >> I'd like to write a PowerShell script to set certain Windows
    >> customizations when setting up a new workstation.
    >> Take for example a mouse setting that enables the Pointer Option named
    >> "Snap To"
    >> (usually setup via a Control Panel accessed Mouse Properties via a
    >> checkbox).
    >> How would I write a PowerShell command to turn that setting on? Or
    >> even better,
    >> how would I do research to learn what how to do that (other than just
    >> asking here) ?
    >> I thought I'd start out with that particular need, and see if I could
    >> see a pattern to do some other customizations.
    >>
    >
    > You might be able to do this using WMI.
    > Look to the Win32_PointingDevice class
    > I do not know that you will find twhat you are looking for, but it's a
    > start.
    >
    I'm tempted to start browsing one of those "1001 Registry Hacks" books.

    One side-effect of learning PowerShell is to get experience with all
    these API's available on a Windows workstation.

    - Larry


      My System SpecsSystem Spec

  5. #5


    Larry__Weiss Guest

    Re: workstation customizations via PowerShell scripts

    Is there a PS provider that manages the functionality that Control Panel provides?

    - Larry


    Larry__Weiss wrote:

    > I'd like to write a PowerShell script to set certain Windows
    > customizations when setting up a new workstation.
    >
    > Take for example a mouse setting that enables the Pointer Option named
    > "Snap To" (usually setup via a Control Panel accessed Mouse Properties
    > via a checkbox).
    > How would I write a PowerShell command to turn that setting on? Or even
    > better, how would I do research to learn what how to do that (other than
    > just asking here) ?
    >
    > I thought I'd start out with that particular need, and see if I could
    > see a pattern to do some other customizations.
    >

      My System SpecsSystem Spec

  6. #6


    Marco Shaw [MVP] Guest

    Re: workstation customizations via PowerShell scripts



    "Larry__Weiss" <lfw@newsgroup> wrote in message
    news:ehD4MTBWKHA.4416@newsgroup

    > Is there a PS provider that manages the functionality that Control Panel
    > provides?
    >
    > - Larry
    No.

    So you use the name "provider"... You're thinking about some kind of
    directory-like-structure that PowerShell could change into so you could work
    on all the settings you see in the UI?

    Marco


      My System SpecsSystem Spec

  7. #7


    Larry__Weiss Guest

    Re: workstation customizations via PowerShell scripts

    Marco Shaw [MVP] wrote:

    > "Larry__Weiss" <lfw@newsgroup> wrote in message
    > news:ehD4MTBWKHA.4416@newsgroup

    >> Is there a PS provider that manages the functionality that Control
    >> Panel provides?
    >>
    > No.
    > So you use the name "provider"... You're thinking about some kind of
    > directory-like-structure that PowerShell could change into so you could
    > work on all the settings you see in the UI?
    >
    Yes, exactly. The directory-like-structure could be based on the hierarchy of
    dialogs that Control Panel uses to access the GUI controls, only standardized
    for consistent access all Windows platforms.

    I'm afraid that the registry settings may not be consistent across Windows
    systems, but that an abstraction of the settings could be exposed via a PS
    Provider with a set of fixed read/write items similar to what the Registry
    provider exposes on a configured Windows system.

    I can imagine PS Providers based on the configuration dialogs for many
    applications, like Windows Explorer and Internet Explorer.

    - Larry


      My System SpecsSystem Spec

workstation customizations via PowerShell scripts

Similar Threads
Thread Thread Starter Forum Replies Last Post
run PowerShell scripts from ASP or asp.net Carlos PowerShell 1 18 Apr 2008
Powershell scripts not working with Vista powershell Ben PowerShell 20 10 Oct 2007
Can't run powershell scripts Craig J. Lindstrom PowerShell 3 03 Oct 2007
Powershell and Logon Scripts klumsy@xtra.co.nz PowerShell 2 29 Jun 2007
Powershell for test scripts Kyle PowerShell 4 27 Jun 2007