r15 - 29 Nov 2010 - 15:18:32 - StephenQYou are here: Wiki >  AppLogic29 Web > RefWinCfg
ALERT! AppLogic 2.9 Documentation The latest production release is AppLogic 3.0.30

wincfg Reference

Overview

The wincfg utility makes it easy for AppLogic users to change the SID, Computer Name and Administrator password for a running Windows appliance from the AppLogic command line shell. wincfg starts the application that contains the appliance if it is not already started.

Important:

  1. The NewSID utility is no longer provided by Sysinternals. Please visit the following wesbites to read further.
  2. The wincfg utility cannot be used to change the computer SID on Windows Server 2008 based appliances. For Windows Server 2003 based appliances, it is assumed that the targetted Windows appliance has the NewSID utility installed in it for the purpose of changing the SID (wincfg prompts the user to download and install NewSID into their Windows appliance). You may obtain NewSID from a source known to you, or use either of the following alternate sources:
  3. The appliance must have ssh access enabled through the default interface (typically ssh access is through port 22; enabling the windows firewall may block port 22 by default).

Usage

Command Syntax

Description: Configure a Windows appliance
Syntax: util wincfg name=app_name:comp_name computer_name= name admin_pw=- --newsid
Arguments: name=app_name:comp_name Name of appliance to configure in the form application_name:component_name
computer_name=name New computer name of the appliance
admin_pw=- The password can be set either directly, by supplying the password string on the command line, or typed to a 'shadow-display' password prompt that does not reveal the entered characters. The shadow entry option is selected by using a single '-' character as the password, i.e. admin_pw=-. The admin_pw=- option should ALWAYS be used to prevent others from potentially seeing the password by hitting the up arrow key.
--newsid Change the SID of the appliance. Windows Server 2003 based appliances only.
Examples: util wincfg name=tst-windows:main.WIN03S computer_name=WIN03TST - Change Computer Name of the Windows appliance to WIN03TST
util wincfg name=tst-windows:main.WIN03S admin_pw=- - Change Administrator password for the Windows appliance.
util wincfg name=tst-windows:main.WIN03S --newsid - Change SID for the Windows appliance
util wincfg name=tst-windows:main.WIN03S computer_name=WIN03TST admin_pw=- - Change Computer Name and Administrator password for the Windows appliance.
util wincfg name=tst-windows:main.WIN03S computer_name=WIN03TST --newsid - Change Computer Name and SID of the Windows appliance.
util wincfg name=tst-windows:main.WIN03S admin_pw=- --newsid - Change Adminstrator password and SID of the Windows appliance.
util wincfg name=tst-windows:main.WIN03S computer_name=WIN03TST admin_pw=- --newsid - Change Computer Name and SID of the Windows appliance.
Notes: wincfg is invoked in the AppLogic command line shell using util wincfg. Help is displayed using help util wincfg.
The option --yes or -y can be added to answer yes to all questions.
If the application was stopped before the command was executed, then wincfg will ask if the application should be started.
* If the answer is yes, then the application is started and the required changes are made. After the appliance is restarted for the changes to take effect, the user is asked if the application should be kept running or shut down.
* If the answer is no, then wincfg performs no action and returns success.
In order for the new SID or computer name changes to take effect the appliance needs to be restarted. Once wincfg changes any of these properties, it will ask the user if it wants to restart the appliance.
* If the user answers no, then it is up to the user the restart the appliance.
* If the user answers yes, the appliance is restarted.
If the application is running and the appliance is stopped, the user is asked whether the appliance should be started.
* If the answer is yes, the appliance is started, the changes are applied and the user is asked whether the appliance should be left running or shut down
* If the answer is no, wincfg performs no action and returns success.

Windows Server 2008 SID

The wincfg utility cannot be used to change the computer SID on Windows Server 2008 based appliances. Microsoft's sysprep may be used to change the SID of such appliances. For more information, please see these websites:

Changing the computer SID with sysprep also restores the OS's Out-of-Box Experience. Many system properties and settings are restored to their defaults.

If sysprep is used to change the SID on a Windows appliance which has Cygwin installed (included in all of the Windows appliance MSI's distributed with AppLogic), then the Cygwin environment needs to be updated to reflect the change to the computer SID. In this case:

  • After executing sysprep, restart the appliance using the --debug option (otherwise the start operation may fail because the sshd service fails to start). Alternatively, prior to executing sysprep, set the sshd service to manaual start (do not forget to reset it to automatic start after using sysprep and restarting the appliance).
  • Login to the desktop of the appliance and open a Cygwin Bash shell. Execute the following commands in this shell:
    • chmod 777 /etc/passwd - ensure passwd file is writable
    • mkpasswd -l -c > /etc/passwd - regenerate passwd file from system users (include new computer SID)
    • sed -i -e 's/^Administrator:/root:/' /etc/passwd - change Administrator to root
    • chmod 777 /var/log/sshd.log - ensure the sshd log file is writable
    • chown -R sshd_server.None /var/empty - ensure directory where sshd stores session files is writable
    • chown sshd_server.None /etc/ssh* - ensure correct ownership of sshd configureation files
    • chmod 600 /etc/ssh* - ensure correct permissions
    • chmod 770 /home/Administrator - ensure correct permissions
    • cygrunsrv --start sshd - start the sshd service - it should start without error

-- ApoorvaKulkarni - 23 Oct 2008

 
Copyright © CA 2005-2012. All Rights Reserved.
%