Package Exports
- windows-server-admin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (windows-server-admin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
windows-server-admin
An npm package to perform various operations on windows server with admin rights. The package handles the execution of commands with admin rights and therefore, can be used directly without running in Administrator mode.
Getting Started
Features
- Start IIS Site
- Stop IIS Site
- Start a windows service
- Stop a windows service
- Execute any command in remote Windows server
Installation
npm i windows-server-admin
Usage
Once installed using npm, require/import the module in the respective file.
var serverAdmin = require('windows-server-admin');
#IIS Actions:
Call the method: performIISOperations with data as the parameter
The format of data to be passed is as follows:
let data = {
"action": "", -- the values expected are: start/stop
"username": "",
"password": "",
"serverIpAddress": "",
"name": ""
};
Now, make a call to the method performIISOperations inside the package as given below:
serverAdmin.performIISOperations(data,(err, stdout, stderr) => { console.log('Response: ', err; });
#Windows Service Operations:
Call the method: performWindowsServiceOperations with data as the parameter
The format of data to be passed is as follows:
let data = {
"action": "", -- the values expected are: start/stop
"username": "",
"password": "",
"serverIpAddress": "",
"name": ""
};
Now, make a call to the method performWindowsServiceOperations inside the package as given below:
serverAdmin.performWindowsServiceOperations(data,(err, stdout, stderr) => { console.log('Response: ', err; });
#Remote Commands on Windows Servers:
Call the method: performRemoteCommands with data as the parameter
The format of data to be passed is as follows:
let data = {
"username": "",
"password": "",
"serverIpAddress": "",
"name": "",
"directory": "",-- Example: "c:\\windows\\system32\\sc"
"command": "" -- Example: "stop serviceName"
};
Now, make a call to the method performRemoteCommands inside the package as given below:
serverAdmin.performRemoteCommands(data,(err, stdout, stderr) => { console.log('Response: ', err; // if err is null, success });