0
우리는 서버를 유지 관리 모드로 원격으로 배치하려고합니다. SCOM functions created by Tom Schumacher을 사용하고 있습니다. 나는이 (가) SCOM 서버에서 다음을 수행하는 경우SCOM 유지 관리 모드를 원격으로 설정할 수 없음
, 프로세스가 완료되고 난 유지 관리 모드에서 서버를 배치하고 다시 그것을 막을 수 있어요 :하지만 난,
#load the function
. C:\temp\opsmanagerFunctions.ps1
#Import the OpsMgr module
Import-Module OperationsManager
#Set server into maintenance mode
Start-serverScommaintenance -servername testserver -message "test" -maintmodeinMinutes '6'
#Stop server maintenance mode
Stop-ServerScommaintenance -servername testserver -message "test complete"
을이 모든 좋은 먼저 서버가 유지 관리 모드에 있어야하는 다른 여러 프로세스를 실행할 다른 서버에서 위의 프로세스를 실행하려고합니다.
: 원격 시스템의 기능을 실행하기 (3 단계), 나는 아래의 오류를 시도한 후,#1
C:\temp\opsmanagerFunctions.ps1
#2
Invoke-Command -ComputerName scomservername -ScriptBlock {Import-Module OperationsManager}
#3
Invoke-Command -ComputerName scomservername ${function:Start-serverScommaintenance}
#4
Invoke-Command -ComputerName scomservername -ScriptBlock {Start-serverScommaintenance -servername testserver -message "test" -maintmodeinMinutes '3'}
#5
Invoke-Command -ComputerName scomservername -ScriptBlock {Stop-ServerScommaintenance -servername testserver -message "test complete"}
그러나 :
내 생각 열차는 보조 서버에서 다음을 실행했다 그래서 같은 Invoke-Command
를 사용하여
The term 'Get-SCOMClassInstance' 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
path is correct and try again.
+ CategoryInfo : ObjectNotFound: (Get-SCOMClassInstance:String) [Get-Command], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
+ PSComputerName : scomserver
내가 그러나 지금은 다른 오류를 받고 있어요, 아래의 사용했습니다 - 내가 대본을 잘못 했습니까? . C : \ Scripts \ Start-serverScommaintenance.ps1 $ s = New-PSSession -ComputerName scomserver Invoke-Command-Session $ s -Scriptblock {가져 오기 모듈 OperationsManager} Invoke-Command-Session $ s -Scriptblock $ {function : Invoke-Command -Session $ s -Scriptblock {서버 시작 테스트 - 서버 test -message "test"-maintmodeinMinutes '6'} – Draaiboek
매개 변수 'DisplayName'의 인수를 확인할 수 없습니다. 인수가 널이거나 비어 있습니다. 널 (null) 또는 비어 있지 않은 인수를 제공 한 후 명령을 다시 시도하십시오. + CategoryInfo : InvalidData : (:), ParameterBindingValidationException [-SCOMClassInstance 받기] + FullyQualifiedErrorId : ParameterArgumentValidationError, Microsoft.SystemCenter.OperationsManagerV10.Commands.GetSCClassInstanceCommand +에는 PsComputerName : – Draaiboek
용어는 '시작 - serverScommaintenance'scomserver 이름으로 인식되지 않습니다 함수, 스크립트 파일 또는 작동 가능 프로그램의 이름. 이름의 철자를 확인하거나 경로에 이 포함되어 있으면 경로가 올바른지 확인하고 다시 시도하십시오. + CategoryInfo : ObjectNotFound : (시작 - serverScommaintenance : 문자열) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException +에는 PsComputerName : – Draaiboek