I found a script that enables/disables storage devices. By default we disable this company wide, but occasionally we are asked to temporarily enable a machine’s USB.
I’ve been excluding workstations from the GPO and then adding them to a GPO that enables the function. Then running gpupdate or waiting for it to take affect. This script really helped.
I made it into a module and so not I can just:
Block-USB -Disable
But to run it on another PC I’d have to:
Invoke-Command -Computername somepc -sScriptblock pathscript.ps1 -Disable
How would I go about making something like this work instead:
Block-USB -Computername somepc -Disable
submitted by /u/DaNPrS
[link] [comments]
The post Configure module to run on network computers appeared first on How to Code .NET.