简体   繁体   中英

Run PowerShell Script In SCOM Via Windows Command Line

I am working with a 3rd party application which creates powershell scripts to place SCOM objects into and out of maintenance mode. How can SCOM be invoked via windows 2012 R2 command line by this 3rd party app and told to execute the script?

Copy the Powershell folder from your SCOM management server (c:\\Program Files\\System Center 2012\\Operations Manager\\Powershell ) to local directory of the server which doesn't have SCOM installation

Copy in the same directory 3 files which are located in "c:\\Program Files\\System Center 2012\\Operations Manager\\server\\SDK Binaries" on your scom server.

In your powershell script add the command line

$path_operationsManager=“yourdirectoryfolder\\Operationsmanager\\OperationsManager.psm1” Import-Module $path_operationsManager new-scommanagementgroupconnection name_of_your_scomgroup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM