Using Powershell:
Remove Management group
$OMCfg = New-Object -ComObject AgentConfigManager.MgmtSvcCfg;
$OMCfg.RemoveManagementGroup("zonetoberemoved")
Add management group
$OMCfg = New-Object -ComObject AgentConfigManager.MgmtSvcCfg;
$OmCfg.AddmanagementGroup(‘zonenametobeadded’,'MSNamewithFQCN',5723)
Friday, July 19, 2013
Friday, June 28, 2013
Run command promt as sytem user
The following link helps for opening command prompt as a system user.
http://verbalprocessor.com/2007/12/05/running-a-cmd-prompt-as-local-system/
http://verbalprocessor.com/2007/12/05/running-a-cmd-prompt-as-local-system/
Thursday, January 17, 2013
Running a powershell script as a Scheduled Task
I found this link to run a powershell script using the Task Scheduler.
http://techhead.co/using-task-scheduler-to-run-a-powershell-script/
To create a simple task to copy a directory from one location to another.Open task scheduler and click Create Basic task.Give the name as Copy task. You can specify and select whether you want to run the task only when you login or keep it running whether a user logs in or not. Once that is done then click the Actions tab and click new. Let the Action be as Start a program. In the Settings text box enter this.
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe
And in the Add arguments enter this after replacing the script path.
–Noninteractive –Noprofile –Command "&{Path to your Script}"
Open notepad and edit the Script file. Enter these lines and save it.
copy-item c:\yourfolderpath -destination c:\destinationpath -recurse
You can start the task and check if the copy is happening. Check the folder permissions and don't add any spaces in the directory names if your copy is not working.
http://techhead.co/using-task-scheduler-to-run-a-powershell-script/
To create a simple task to copy a directory from one location to another.Open task scheduler and click Create Basic task.Give the name as Copy task. You can specify and select whether you want to run the task only when you login or keep it running whether a user logs in or not. Once that is done then click the Actions tab and click new. Let the Action be as Start a program. In the Settings text box enter this.
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe
And in the Add arguments enter this after replacing the script path.
–Noninteractive –Noprofile –Command "&{Path to your Script}"
Open notepad and edit the Script file. Enter these lines and save it.
copy-item c:\yourfolderpath -destination c:\destinationpath -recurse
You can start the task and check if the copy is happening. Check the folder permissions and don't add any spaces in the directory names if your copy is not working.
Subscribe to:
Posts (Atom)