Creating a configuration script

Why should I create a configuration script?

  1. The main reason is for security if you plan on using the encrypted module. By default the service is installed with a public key that is know by anyone who downloads this software its not recommended to key this default key.
  2. Another reason is to configure some of the other default settings such as the log file or whether or not you want the service to be disabled after running the first time.
  3. If you plan on using the NEW Notification Provider feature you'll also need to do some configuration after starting the service

What a sample configuration script might look like

The script below gives you an idea of what you can do with a configuration script. I don't recommend disabling the RunOnce feature but if you need to do it its defiantly possible.

## Import Module for CloudInit
import-module CloudInitAdministration

## Update the security key
Set-CISetting -Name SecretKey -Value "tuT6J6_CZDg3gFYaW01nUKTnl_MQPbI4"

## Disable the RunOnce feature
Set-CISetting -Name RunOnce -Value 0

## Add the EmailNotification provider to get emailed when a log is created
Add-CINotificationProvider EmailNotification

## Configure the settings for the email notification
Set-CINotificationSetting -ProviderName EmailNotification -Name FromEmail -Value ""
Set-CINotificationSetting -ProviderName EmailNotification -Name ToEmail -Value ""
Set-CINotificationSetting -ProviderName EmailNotification -Name MailServer -Value ""

Last edited Jan 27, 2012 at 6:19 PM by bwight4157, version 2


No comments yet.