Hello everyone! This is my first time posting on this forum, and I'm trying to enhance a script I've been working on. The script searches an array of computers for all services that are using a specific account, useful for checking before you change a service account's password or disable it.
Here's where the script now stands...
param(
[string[]]$account=@(),
[string[]]$computers=@(),
[switch]$help
)
$account=@($Input)
$computers = @($input)
Get-WmiObject win32_service -ComputerName $computers | where-object {$_.startname -eq "$account"} | sort-object systemname | format-table systemname,displayname,startname | out-host
if($help){
@"
SYNTAX:
get-servicesbylogon -account "domain\user" -computers "computer1,computer2"
I just added the param options into the script, but they don't work. When I try using the script with the parameters, I get no returns when I know I should. Thoughts as to why?
Thanks in advance for any help!