montaque

小碗喝酒,小口吃肉

博客园 首页 新随笔 联系 订阅 管理

ILM 是微软的身份管理软件。 当一个员工进入公司后,ILM 会把这个人的身份标识(AD帐号,或者Email邮箱,证书,系统帐号)漫游到各个系统中。并且维持这个身份的一致性。

ILM 的实现思路是不同的系统有不同的Agent,比如AD Agent ,SAP Agent,或者按照他的SDK去实现一个自己的Agent。 每个Agent 里面对应的身份标识属性存在自己的Connector Space中。这个属性可以Sync到Metaverse中或者从Metaversion export到Agent中。

一般的典型场景是新员工入职,HR系统录入员工资料。 然后ILM 会根据业务规则帮他创建AD帐号,邮箱。然后把创建号的邮箱写会SAP. 当然离职后,就是disable帐号,收回资源。该员工的升迁,换部门,location等也都会同步到其他系统中

有时候,IT 希望能够看到或者Audit所有有ILM发起的AD 变更。这个时候可以通过配置他的Profile在Export的时候,Enable logging,该log是个xml文件,自己写个XSL去parse就可以了。

这里提供了一个我验证过的xsl。

<?xml version="1.0"  ?>
<xsl:stylesheet version="1.0" xmlns:ilm="http://www.microsoft.com/mms/mmsml/v2"   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
 
  <xsl:template match="//ilm:directory-entries">
    <html>
      <body>
        <h2>
         Pending Changes.
        </h2>
        <table border="1">
          <tr bgcolor="#0066FF">
            <th>Operation</th>
            <th>DN</th>
            <th>Attributes</th>
          </tr>
          <xsl:for-each select="ilm:delta">
            <tr>
              <xsl:choose>
                <xsl:when test = "@newdn">
                  <td>
                    <font size="2">rename</font>
                  </td>
                  <td>
                    <font size="2">
                      <xsl:value-of select="@dn" />
                      <br></br>
                      <xsl:value-of select="@newdn" />
                    </font>
                  </td>
                </xsl:when>
                <xsl:otherwise>
                  <td>
                    <font size="2">
                      <xsl:value-of select="@operation" />
                    </font>
                  </td>
                  <td>
                    <font size="2">
                      <xsl:value-of select="@dn" />
                    </font>
                  </td>
                </xsl:otherwise>
              </xsl:choose>
         
              <td>
                <table border="0">
                  <xsl:for-each select="ilm:dn-attr">
                    <tr>
               
                      <xsl:if test = "@multivalued='false'">
                        <xsl:choose>
                          <xsl:when test = "ilm:attr/@operation='add'">
                            <td bgcolor="#CCFFCC">
                              <font size="2">
                                <xsl:value-of select="@name" /> add
                              </font>
                            </td>
                          </xsl:when>
                          <xsl:when test = "ilm:attr/@operation='delete'">
                            <td bgcolor="#CC6666">
                              <font size="2">
                                <xsl:value-of select="@name" /> delete
                              </font>
                            </td>
                          </xsl:when>
                          <xsl:otherwise>
                            <td bgcolor="#CCCCFF">
                              <font size="2">
                                <xsl:value-of select="@name" />
                              </font>
                            </td>
                          </xsl:otherwise>
                        </xsl:choose>

                        <td>
                          <xsl:for-each select="ilm:dn-value">
                            <table border="0">
                              <xsl:choose>
                                <xsl:when test = "@operation='delete'">
                                  <tr>
                                    <td>
                                      <font size="2">delete:
                                        <xsl:value-of select="ilm:dn" />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:when>
                                <xsl:when test = "@operation='add'">
                                  <tr>
                                    <td>
                                      <font size="2">add:
                                        <xsl:value-of select="ilm:dn" />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:when>
                                <xsl:otherwise>
                                  <tr>
                                    <td>
                                      <font size="2">
                                        <xsl:value-of select="ilm:dn" />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:otherwise>
                              </xsl:choose>
                            </table>
                          </xsl:for-each>
                        </td>
                      </xsl:if>
 
                      <!--<xsl:if test = "@multivalued='false'">
                        <td bgcolor="#CCCCFF">
                          <font size="2">
                            <xsl:value-of select="@name" />
                          </font>
                        </td>
                        <td>
                          <font size="2">"
                            <xsl:value-of select="dn-value/dn" />
                          </font>
                        </td>
                      </xsl:if>-->
                    </tr>
                  </xsl:for-each>
             
                  <xsl:for-each select="ilm:attr">
                    <tr>
                  
                      <xsl:if test = "@multivalued='true'">
                        <xsl:choose>
                          <xsl:when test = "ilm:attr/@operation='add'">
                            <td bgcolor="#CCFFCC">
                              <font size="2">
                                <xsl:value-of select="@name" /> add
                              </font>
                            </td>
                          </xsl:when>
                          <xsl:when test = "ilm:attr/@operation='delete'">
                            <td bgcolor="#CC6666">
                              <font size="2">
                                <xsl:value-of select="@name" /> delete
                              </font>
                            </td>
                          </xsl:when>
                          <xsl:otherwise>
                            <td bgcolor="#CCCCFF">
                              <font size="2">
                                <xsl:value-of select="@name" />
                              </font>
                            </td>
                          </xsl:otherwise>
                        </xsl:choose>

                        <td>
                          <xsl:for-each select="ilm:value">
                            <table border="0">
                              <xsl:choose>
                                <xsl:when test = "@operation='delete'">
                                  <tr>
                                    <td>
                                      <font size="2">delete:
                                        <xsl:value-of select="." />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:when>
                                <xsl:when test = "@operation='add'">
                                  <tr>
                                    <td>
                                      <font size="2">add:
                                        <xsl:value-of select="." />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:when>
                                <xsl:otherwise>
                                  <tr>
                                    <td>
                                      <font size="2">
                                        <xsl:value-of select="." />
                                      </font>
                                    </td>
                                  </tr>
                                </xsl:otherwise>
                              </xsl:choose>
                            </table>
                          </xsl:for-each>
                        </td>
                      </xsl:if>
                 
                      <xsl:if test = "@multivalued='false'">
                        <xsl:if test = "@name!='unicodePwd'">
                          <xsl:if test = "@name!='msExchMailboxSecurityDescriptor'">
                            <td bgcolor="#CCCCFF">
                              <font size="2">
                                <xsl:value-of select="@name" />
                              </font>
                            </td>
                            <td>
                              <font size="2">
                                <xsl:value-of select="ilm:value" />
                              </font>
                            </td>
                          </xsl:if>
                        </xsl:if>
                      </xsl:if>
                    </tr>
                  </xsl:for-each>
                  <xsl:variable name="CHILD">
                    <xsl:value-of select="count(ilm:attr)"/>
                  </xsl:variable>
                  <xsl:if test="$CHILD=0">
                    No Other Changes
                  </xsl:if>
                 

                </table>
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

posted on 2008-01-17 04:34  montaque  阅读(676)  评论(1编辑  收藏  举报