Microsoft Identity Integration Server 2003 Developer Reference

MIIS_PasswordChangeHistorySource

The MIIS_PasswordChangeHistorySource class represents a history entry of each password change request from the originating connected data source. To use this class, you must be logged on as a member of either the MIISBrowse or the MIISAdmins security group.

The following syntax is simplified from MOF code and includes all inherited properties.

class MIIS_PasswordChangeHistorySource
{
  String CsGuid;
  String DN;
  String GUID;
  String MaGuid;
  String MIISReceiveTime;
  String ReferenceGuid;
  String ReturnCode;
  String SourceChangeTime;
  String SourceServer;
};

Methods

The MIIS_PasswordChangeHistorySource class defines the following method.

Method Description
EventDetails Returns the details, in an XML format, of a history entry for each password change request sent from the originating connected data source to the MIIS Server in XML format.

Properties

The MIIS_PasswordChangeHistorySource class has the following properties.

CsGuid
Data type: String
Access type: Read-only

Gets the connector space globally unique identifier (GUID) of the object.

DN
Data type: String
Access type: Read-only

Gets the distinguished name of the object.

GUID
Data type: String
Access type: Read-only
Qualifiers: Key

Gets the tracking GUID that is used to identify the password change request. This value is assigned by the MIIS server to track the password change request.

MaGuid
Data type: String
Access type: Read-only

Gets the globally unique identifier (GUID) of the management agent that receives the password change request.

MIISReceiveTime
Data type: String
Access type: Read-only

Gets the date and time in Coordinated Universal Time that the password change was received by the MIIS server.

ReferenceGuid
Data type: String
Access type: Read-only

Gets the reference GUID assigned by the Password Change Notification Service (PCNS) in the domain controller of the password change request.

ReturnCode
Data type: String
Access type: Read-only

Gets the results of the password change request.

SourceChangeTime
Data type: String
Access type: Read-only

Gets the date and time in Coordinated Universal Time that the password was changed on the source server.

SourceServer
Data type: String
Access type: Read-only

Gets the name of the source server that changed the password.

Remarks

The class supports the following restricted set of queries:

Each query field can only appear once except when searching for a history entry that occurred before or after a specified time. Query fields can be combined using the AND operator. For example, Set changeHistories = Service.ExecQuery("Select * from MIIS_PasswordChangeHistorySource WHERE MaGuid = '" & MIIS_ManagementAgent.Guid & "' AND CsGuid = '" & MIIS_CSObject.Guid & "')"

In the previous example, the WHERE statement can use the following items:

Each Query Field can only appear once. All of them can be ANDed with each other.

Example Code [Visual Basic .NET]

The following Visual Basic Scripting Edition (VBScript) example shows how to use this class to get the password change history by user.

Option Explicit

On Error Resume Next

Const PktPrivacy = 6	' Authentication level
Dim Service			 ' Service object
Dim queryString		 ' SQL Query string
Dim userName			' sAMAccountName of the user
Dim domainName		' User domain
Dim errorString		 ' Error string
Dim statusString		' Status string
Dim CSUsers			 ' Connector space user collection
Dim User				' Connector space user
Dim changeHistories	 ' Change history collection
Dim changeHistory	 ' Change history member

userName = "jeffsmith"
domainName ="fabrikam"
Set Service = GetObject("winmgmts:{authenticationLevel=PktPrivacy}!root\MicrosoftIdentityIntegrationServer")
If err.number<>0 then 
	errorString = "Could not retrieve service object: "
	errorString = errorString & Err.Description
	ErrorHandler(errorString)
End If

queryString = "Select * From MIIS_CSObject WHERE Domain = "
queryString = queryString & "'" & domainName & "' "
queryString = queryString & "and account = '" & userName & "'"
Set CSUsers = Service.ExecQuery(queryString)
If err.number <> 0 then
	errorString = "Could not find the user: "
	errorString = errorString & err.Description
	ErrorHandler(errorString)
End If

If CSUsers.Count = 0 then 
	statusString = "No users with that sAMAccountName."
	ErrorHandler(statusString)
End If 

For each User in CSUsers
	queryString = "Select * from MIIS_PasswordChangeHistorySource WHERE "
	queryString = queryString & "CsGuid = '"
	queryString = queryString & User.Guid & "'"
	Set changeHistories = Service.ExecQuery(queryString)
	If err.number <> 0 then
		errorString = "Could not retrieve password change history: " 
		errorString = errorString & Err.Description
		ErrorHandler(errorString)
	End If

	If changeHistories.Count = 0 then
		statusString = "There are no password change histories for the " 
		statusString = statusString & "user " & User.Account & "."
		WScript.Echo statusString
	Else
		For Each changeHistory in changeHistories
			statusString = "Change History for this user "
			statusString = statusString & userName &":"
			WScript.Echo statusString
			WScript.Echo changeHistory.eventDetails
		Next
	End If
Next

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

Requirements

Server: Requires Microsoft Identity Integration Server 2003 Service Pack 1.
Header: Declared in mmswmi.mof.


See Also

Example: Searching for Password Change Requests from a Connected Data Source