Welcome to TechNet Blogs Sign in | Join | Help

Enterprise IT Identity & Access Management

A Buyer's & Integrator's Guide - WebLog Version 1.0

Syndication

News

Hi, I've moved into an Information Security Research & Strategy role from an IAM Architecture role. So this blog site is retired. I may launch a security blog in the future. Thank you all for visiting!
Sample Code (VBScript) - Retrieve MIIS WMI Password History

This is a sample WMI script to retrieve password change history for a specific account through MIIS. You just need to run it on MIIS server with MA name, domain name and account name as parameters.

Option Explicit

On Error Resume Next

Dim Service
Dim CsObjects
Dim CsObject
Dim Arguments
Dim domainName
Dim ma
Dim account
Dim MVGuid
Dim password
Dim oldPassword
Dim r

Set Arguments = WScript.Arguments.Named

domainName = Arguments.Item("D")
account = Arguments.Item("A")
ma = Arguments.Item("M")

Set Service = GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set CsObjects = Service.ExecQuery("Select * from MIIS_CSObject where domain='" + domainName + "' and account='" + account + "'")

For each CsObject in CsObjects
   MVGuid = CsObject.MVGuid
Next

Set CsObjects = Service.ExecQuery("Select * from MIIS_CSObject where mvguid='" + MVGuid  + "'")

For each CsObject in CsObjects
   if LCase(CsObject.MAName) = LCase(ma) then
 wscript.echo "Retrieving MIIS WMI Password History ..."
 wscript.Echo CsObject.PasswordChangeHistory
   end if
Next

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
  WScript.Quit(1)
End Sub

Published Monday, April 10, 2006 10:00 PM by Yale Li

Filed under:

Comments

No Comments

Anonymous comments are disabled
Page view tracker