неділя, 26 жовтня 2008 р.

Add Group to Local Admins

Стандартна ситуація - необхідно програмними засобами додати деяку доменну або локальну групу до групи локальних адміністратрів машини. Приводжу простий код на c#, що виконує дану задачу:

using System;
using System.DirectoryServices;
using System.Collections;

namespace AddLocalAdmin
{
    class Program
    {
        public static void AddGroupToLocalAdmins(string GroupAdd)
        {
            bool IsPresent = false;
            DirectoryEntry grp = new DirectoryEntry("WinNT://" + Environment.MachineName + "/Administrators,group");
            object members = grp.Invoke("members", null);
            foreach (object groupMember in (IEnumerable)members)
            {
                DirectoryEntry member = new DirectoryEntry(groupMember);
                if (member.Name == GroupAdd) IsPresent = true;
            }
            if (!IsPresent) grp.Invoke("Add", "WinNT://" + Environment.MachineName + "/" + GroupAdd + ",group");
            else
            {
                Console.WriteLine("Already present");
                
            }
            grp.CommitChanges();
        }
        public static void Main(string[] args)
        {
            try
            {
                AddGroupToLocalAdmins(args[0]);
                Console.WriteLine("huj {0}", args[0]);
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\n" + ex.StackTrace + "\n" + ex.Source); 
                Console.ReadLine();

            }
        }
    }
}

Якщо замість локальної додаємо доменну групу, то в методі grp.Invoke замість парамтеру "WinNT://" + Environment.MachineName + "/" + GroupAdd + ",group" вказуємо "WinNT:///" + GroupAdd + ",group"
Можливо комусь цей код і стане в нагоді.

понеділок, 13 жовтня 2008 р.

OCS 2007: ABS issues

Кожен адміністратор, після розгортання OCS 2007 стикається з багатьма проблемами, наприклад - синхронізація клієнтів з глобальною адресною книгою. В процесі її вирішення натрапив на досить непогану статтю, що описує типові проблеми ABS: http://ucnoevil.blogspot.com/2008/03/address-book-chaos.html. 

Також наведу іншу, досить лаконічну інструкцію з траблшутінгу даної служби:

 

Cannot synchronize address book information

Background. The OLC 2007 client says “Cannot synchronize address book information”

Cause: Misc. Related to IIS.

Look in the IIS logs to see which error code you are getting when the client
tries to download the address book

 

If you are seeing 403.1 - “Unauthorized access because the logon has failed”, try either:

  1. Remove SSL. You’ll have to disable SSL in IIS and Change the OCS AB URL path in WMI.
  2. OR, keep SSL enabled, but make sure that you can resolve the name (and successfully connect to) the CA’s CRL distribution point.

 

If you are seeing 403.14 - “Forbidden because the directory listing is denied”:

Enable directory browsing in IIS for the ABS application under the default web site;

 

If you are seeing Kerberos auth problems, you may need to add the SPN for IIS to the domain.

SetSpn -A HTTP/FQDN of IIS Server NetBios Name of IIS Server

 

Michael Folin
Systems Engineer
michael@folin.com

 

Проте, пройшовши всі кроки, описані в наведених статтях і не знайшовши вирішення, звернув увагу на правила публікації ISA 2006 - на закладці Authentication Delegation було встановлено значення No delegation, and clients can't authenticate directly. Це означає, що будь-який запис на авторизацію, надісланий клієнту ISA не передаватиме, саме тому в логах IIS і виникали помилки 401 2. Як тільки було встановлено значення No delegation, but clients may authenticate directly, проблему було вирішено. 

неділя, 5 жовтня 2008 р.

SCVMM 2008, знайомство

На днях зареєструвався на участь в тестуванні іспиту TS: System Center Virtual Machine Manager 2008, Configuring. Участь на період тестування безкоштована, проте за умов успішної здачі статус TS є цілком реальним. Ось деякі основні моменти, котрі необхідно врахувати при підготовці до іспиту(з сайту Microsoft):

Installing SCVMM
  • Install SCVMM server components
    • May include but is not limited to: Server prerequisites, database, Windows versions, enabling SAN migration, User Access Control (UAC) issues.
  • Install administrator console
    • May include but is not limited to: Administrator console prerequisites, platform support, firewall settings, Workgroup requirements vs. Domain requirements, custom ports, managed hosts from admin console, enable reporting for admin console.
  • Install self-service portal
    • May include but is not limited to: self-service portal prerequisites, IIS components, compatibility, custom ports, host headers.
  • Install PRO tips
    • May include but is not limited to: Ops manager, management packs, Admin consoles, security.
Administering SCVMM
  • Configure user roles
    • May include but is not limited to: delegate admin, setting permissions for specific host or host groups, using self-service portal to create test environment, add delegated administrator.
  • Setup self service
    • May include but is not limited to: enabling user or group for self service, setting custom ports for self service, establishing quota, Self-provisioning (templates).
  • Maintain VMM library
    • May include but is not limited to: adding a library, adding additional library shares or servers, moving files to library share, mapping ISOs, types of library files.
  • Configure hosts
    • May include but is not limited to: adding hosts, installing a local agent, adding VMware VC server, configuring a virtual network, creating filters in the console.
  • Monitor jobs
    • May include but is not limited to: verifying specific jobs, recovering from job failure, change tracking, job filtering.
Maintaining and Monitoring VMs
  • Configure VM hardware
    • May include but is not limited to: NIC configuration, configuring VM drive, configuring memory, configuring CPU.
  • Manage virtual instance checkpoints and patches
    • May include but is not limited to: Checkpoints, creating a checkpoint of a VM, deploying patches.
  • Monitoring and reporting VMs
    • May include but is not limited to: integrating Ops Manager, selecting potential virtualization targets, monitoring utilization.
Deploying and Migrating VMs
  • Convert from physical or virtual platforms
    • May include but is not limited to: P2V, V2V.
  • Move VMs between hosts
    • May include but is not limited to: migrating a SAN, migration options, intelligent placement.
  • Deploy VMs
    • May include but is not limited to: deploy VM from VHD, deploy VM from template, create template from existing VM, provisioning new machines and applications, intelligent placement.
  • Deploy a High Availability VM
    • May include but is not limited to: configuring host clustering, configuring guest clustering, configuring a VM for high availability, configuring library shares for high availability.