Skip to content

RunAsLoggedOnUserContext.ps1 returning error. #4

@MaxPresi

Description

@MaxPresi

When I try to use the script, it returns the error below.

Script is not running as SYSTEM. This script is designed to run in the SYSTEM context. No C:\WINDOWS\Action1\scripts\Run_Script_82d13990-5752-11f0-ba8c-c30a9a7fe6e4_Script.ps1:425 caractere:9 + throw "Script is not running as SYSTEM. This script is design ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (Script is not r...SYSTEM context.:String) [], RuntimeException + FullyQualifiedErrorId : Script is not running as SYSTEM. This script is designed to run in the SYSTEM context.

I'm running it as a script, not as software (running the .ps1 file).

If I comment out this part, except for the verification that it's running via the System user, the script works, but it doesn't run the command (between the @' '@) with administrative permissions.

Does anyone know what it can be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions