-1

Powershell と動的状態の構成は初めてです。Windows タスク スケジューラで多数のタスクをセットアップする展開スクリプトを動作させようとしています。スクリプトを作成し、ローカル マシンで実行しようとしています。

Configuration AppServerTasks {
    param($NodeName)
    Import-DscResource -Module StackExchangeResources    

    Node $NodeName
    {
        $trackingFilePath = "...";
        $tracksFilePath = "...";
        $reportingFilePath = "...";

        ScheduledTask TrackTask
        {
            Name = "Tracks"
            FilePath = $tracksFilePath
            Daily = $true
            Hours = 0
            Minutes = 5
        }

        ScheduledTask TrackingTask
        {
            Name = "Tracking"
            FilePath = $trackingFilePath
            Daily = $true
            Hours = 0
            Minutes = 5
        }

        ScheduledTask ReportingTask
        {
            Name = "Reporting"
            FilePath = $reportingFilePath
            Daily = $true
            Hours = 0
            Minutes = 5
        }
    }
}

AppServerTasks -NodeName "localhost"
Start-DscConfiguration AppServerTasks -Wait -Verbose -Force

ただし、これは「アクセスが拒否されました」で失敗しています。これから得られるエラーは次のとおりです。

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' =
 MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer MEEP with user sid S-1-5-21-2331283068-2376342717-1560730737-1001.
VERBOSE: [MEEP]: LCM:  [ Start  Set      ]
VERBOSE: [MEEP]: LCM:  [ Start  Resource ]  [[ScheduledTask]TrackTask]
VERBOSE: [MEEP]: LCM:  [ Start  Test     ]  [[ScheduledTask]TrackTask]
VERBOSE: [MEEP]:                            [[ScheduledTask]TrackTask] Unable to find matching job.
VERBOSE: [MEEP]: LCM:  [ End    Test     ]  [[ScheduledTask]TrackTask]  in 0.0160 seconds.
VERBOSE: [MEEP]: LCM:  [ Start  Set      ]  [[ScheduledTask]TrackTask]
Connecting to remote server MEEP failed with the following error message : Access is denied. For more information, see the 
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:) [], CimException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

VERBOSE: [MEEP]: LCM:  [ End    Set      ]  [[ScheduledTask]TrackTask]  in 0.0150 seconds.
The PowerShell DSC resource StackExchange_ScheduledTask threw one or more non-terminating errors while running the 
Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. 
Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

VERBOSE: [MEEP]: LCM:  [ Start  Resource ]  [[ScheduledTask]TrackingTask]
VERBOSE: [MEEP]: LCM:  [ Start  Test     ]  [[ScheduledTask]TrackingTask]
VERBOSE: [MEEP]:                            [[ScheduledTask]TrackingTask] Unable to find matching job.
VERBOSE: [MEEP]: LCM:  [ End    Test     ]  [[ScheduledTask]TrackingTask]  in 0.0000 seconds.
VERBOSE: [MEEP]: LCM:  [ Start  Set      ]  [[ScheduledTask]TrackingTask]
Connecting to remote server MEEP failed with the following error message : Access is denied. For more information, see the 
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:) [], CimException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

VERBOSE: [MEEP]: LCM:  [ End    Set      ]  [[ScheduledTask]TrackingTask]  in 0.0320 seconds.
The PowerShell DSC resource StackExchange_ScheduledTask threw one or more non-terminating errors while running the 
Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. 
Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

VERBOSE: [MEEP]: LCM:  [ Start  Resource ]  [[ScheduledTask]ReportingTask]
VERBOSE: [MEEP]: LCM:  [ Start  Test     ]  [[ScheduledTask]ReportingTask]
VERBOSE: [MEEP]:                            [[ScheduledTask]ReportingTask] Unable to find matching job.
VERBOSE: [MEEP]: LCM:  [ End    Test     ]  [[ScheduledTask]ReportingTask]  in 0.0000 seconds.
VERBOSE: [MEEP]: LCM:  [ Start  Set      ]  [[ScheduledTask]ReportingTask]
Connecting to remote server MEEP failed with the following error message : Access is denied. For more information, see the 
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:) [], CimException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or 
empty, and then try the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
    + PSComputerName        : localhost

VERBOSE: [MEEP]: LCM:  [ End    Set      ]  [[ScheduledTask]ReportingTask]  in 0.0150 seconds.
The PowerShell DSC resource StackExchange_ScheduledTask threw one or more non-terminating errors while running the 
Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. 
Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.139 seconds

グーグルを試しました(問題のコンテキストの原因がわからないため)。しかし、他の人がこれと同様の問題を抱えているにもかかわらず、提案された修正が機能しなかったため、役に立ちませんでした. これを管理者として POwershell ISE で実行しています。試してみEnable-PSRemoting -forceましたが、有効になっています。次に何をすべきかわからない。

あなたの考え?ありがとう。

4

1 に答える 1