< Back

Find-TaskServiceUser

Mon Jan 13, 2020 7:22 pm

NAME Find-TaskServiceUser



SYNOPSIS

Finding scheduled tasks, system services on computer by user name.





SYNTAX

Find-TaskServiceUser [[-Computer] <String[]>] [-User <String[]>] [-Strict] [-Service] [-Task] [-Minimal] [-Export]

[-Exportpath <String>] [-ExportJSON] [-ExportJSONpath <String>] [-Log] [-Logfile <String>] [<CommonParameters>]





DESCRIPTION

Finding scheduled tasks, system services on local or remote computer by given user name.

'Administrator' and local computer are default values.

The results can be redirected to the log file (see 'log' parameter).





PARAMETERS

-Computer <String[]>

Computer to find tasks/services. Default value is 'localhost' ($env:COMPUTERNAME).



Required? false

Position? 1

Default value $env:COMPUTERNAME

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-User <String[]>

User name to find scheduled tasks or system services. Default value is 'Administrator'.



Required? false

Position? named

Default value Administrator

Accept pipeline input? false

Accept wildcard characters? false



-Strict [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Service [<SwitchParameter>]

A Switch to look for system services where user name is matched.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Task [<SwitchParameter>]

A Switch to look for scheduled tasks where user name is matched.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Minimal [<SwitchParameter>]

A switch to enable minimalistic results. Object containing the computer name, number of tasks and/or number of

services only. With -Log information about log file path is displayed but log file is not minimal. The return

value is en object.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Export [<SwitchParameter>]

Enable exporting results objectsr to file (using "Export-Clixml"). Export file path is defined in "Exportpath"

parameter.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Exportpath <String>

File name path to export results finding scheduled tasks and/or system services.



Required? false

Position? named

Default value [Environment]::GetFolderPath("MyDocuments") + "\\Find-TaskServiceUser.XML"

Accept pipeline input? false

Accept wildcard characters? false



-ExportJSON [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ExportJSONpath <String>



Required? false

Position? named

Default value [Environment]::GetFolderPath("MyDocuments") + "\\Find-TaskServiceUser.json"

Accept pipeline input? false

Accept wildcard characters? false



-Log [<SwitchParameter>]

A switch to enable logging of output data to a log file. The log file with the path is defined in "LogFile"

parameter.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Logfile <String>

Path with file name where logging output. Default value is [$env:TEMP]\\find-taskserviceuser.log. Works only

with Log switch.



Required? false

Position? named

Default value "$env:TEMP\\Find-TaskServiceUser.log"

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





ICON CREDITS: Module icon made by [Freepik](https://www.freepik.com/) from

[Flaticon](https://www.flaticon.com/) is licensed [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)

DONATION: If you want to support my work

https://www.paypal.com/cgi-bin/webscr?c ... source=url



-------------------------- EXAMPLE 1 --------------------------



PS>Find-TaskServiceUser -Computer "WSRV00" -User "BobbyK" -Service -Task -Log



Description

-----------

Find system services and scheduled tasks on "WSRV00" for user name is matched "BobbyK". Logging is enabled.









-------------------------- EXAMPLE 2 --------------------------



PS>"WSRV01","WSRV02" | Find-TaskServiceUser -Service -Task



Description

-----------

Find system services and scheduled tasks on computers "WSRV01", "WSRV02" where user name is matched

"Administrator".









-------------------------- EXAMPLE 3 --------------------------



PS>$data = Find-TaskServiceUser -Task -Service -Server "WSRV04" -User "SYSTEM" -Minimal



PS> $data



Description

-----------

Find tasks and services on server "WSRV04" for "SYSTEM" user and return a minimalistic result as custom object

`$data`.









-------------------------- EXAMPLE 4 --------------------------



PS>"WSRV01","WSRV10" | Find-TaskServiceUser -Service -Task -Export



PS> $data = Import-Clixml "C:\\Users\\test_user\\Documents\\Find-TaskServiceUser.XML"

PS> $data.Tasks | Format-Table -Autosize

PS> $data.Services | Format-Table -Autosize



Description

-----------

Find system services and scheduled tasks on computers "WSRV01", "WSRV10" where user name is matched

"Administrator". Results are exported to XML file and then imported to $data variable. Results are displayed.











RELATED LINKS

https://github.com/voytas75/Find-TaskServiceUser

https://www.powershellgallery.com/packa ... erviceUser