2017-02-20 1 views
1

J'utilise la commande ci-dessus pour obtenir la liste des utilisateurs actuellement connectés. Il fonctionne bien quand je lance le script Powershell contenant cette commande, mais quand je lance ce même script du planificateur de tâches, il donne l'erreur suivante:

"The term 'quser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.", 
      "stack_trace": " at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context) 
    at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope) 
    at System.Management.Automation.CommandFactory._CreateCommand(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope) 
    at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource) 
    at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context) 
    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) 
    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) 
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)". 
+0

Sous quel compte d'utilisateur la tâche est-elle exécutée? Le 'quser.exe' devrait résider dans' c: \ windows \ system32' qui devrait être dans le chemin. – vonPryz

Répondre

1

QUser.exe réside dans C: \ Windows \ System32. Donc, si vous allez dans le répertoire et l'exécutez, cela fonctionnera.

Voici la référence complète pour le même avec toutes les captures d'écran.

QUser

Hope it helps.