Utils.TransactionProperties is cleared
I am trying to set a value of Utils.TransactionProperties on the Import from the SQL MA in ILM2. The value gets set, I can write the value to a text file at this point. Later I want to read the value on the exportto AD MA, but at that time the value is cleared already. I am following this threads http://social.technet.microsoft.com/Forums/en-US/identitylifecyclemanager/thread/9096318b-9825-4235-9b2e-bdcd68c621fd example:
SQL import flow rule:
Case "import_userPassword" If Not mventry("userPassword").IsPresent Or _ (mventry("userPassword").IsPresent AndAlso _
mventry("userPassword").Value <> csentry("user_Password").Value) Then mventry("userPassword").Value = csentry("user_Password").Value Utils.TransactionProperties.Add("PasswordUpdated", True) End If
AD export flow rule:
Case "export_unicodePwd" Try If Utils.TransactionProperties("PasswordUpdated").Equals(True) Then csentry("unicodepwd").Value = mventry("userPassword").Value End If Catch ex As NullReferenceException End Try
Does someone know why the value is cleared?
May 20th, 2009 9:15pm
How do you know that the value was cleared?Cheers,MarkusMarkus Vilcinskas, Technical Content Developer, Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2009 1:19am
I can write the value out to a file right after it is created.
May 21st, 2009 6:19pm
A transaction property is only good for one transaction. It is good that you have verified whether the property was set.
The next question in your example is whether the export flow rule is processed.
Has your SQL MA the required precedence to initiate the EAF flow to AD?
If not, your EAF flow rule code is not processed
Have you looked at preview to verify that the EAF code has been even processed?
By the way, your transaction code example contains bad coding. In your scenario, you only need to know whether the property exists the actual value is irrelevant.
You should replace this with If Utils.TransactionProperties.Contains(<Name>)
That way, you dont need exception handling for a logical error in your code.Cheers,MarkusMarkus Vilcinskas, Technical Content Developer, Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2009 10:10pm
Markus, thank you for your quick relpy.I wrote out to a file the value of Utils.TransactionProperties.Contains("PasswordUpdated") on the EAF flow. The value was False.May be it is not in the same transaction, but I am not sure what would be the scope of one transaction.
May 21st, 2009 11:09pm
This is odd...In this case, there must be something else wrong.How could you get a false written to your file?According to your code, you are only setting a true: "Utils.TransactionProperties.Add("PasswordUpdated", True)"One transaction is one end-to-end cycle for a connector space objectn- from a connector space to the metaverse, and then to all other connector spaces.This is another problem of the boolean evaluation in conjunction with transaction properties....You should change your code according to my previous comment andcheck whether the propertyexists in your EAF code.What code where youusing to write the value to a file?Cheers,MarkusMarkus Vilcinskas, Technical Content Developer, Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2009 12:00am
To write the value to a file I was using the same code asyou suggested Utils.TransactionProperties.Contains("PasswordUpdated").Here is my exact code for the whole thing:Source MA
Public
Sub MapAttributesForImport(ByVal FlowRuleName As String, ByVal csentry As CSEntry, ByVal mventry As MVEntry) Implements IMASynchronization.MapAttributesForImport
Select Case FlowRuleName
Case "ImportPasswordStr"
Try
'If Not mventry("c_userPasswordStr").IsPresent Or (mventry("c_userPasswordStr").IsPresent AndAlso _
' mventry("c_userPasswordStr").Value <> csentry("Password").Value) Then
mventry(
"c_userPasswordStr").Value = csentry("Password").Value
Utils.TransactionProperties.Add(
"PasswordUpdated", True)
LogMsg(Utils.TransactionProperties(
"PasswordUpdated").ToString)
'End If
Catch ex As Exception
LogMsg(
"ImportPasswordStr Exception:" + ex.Message)
End Try
Case Else
End Select
End Sub
Public Sub MapAttributesForExport(ByVal FlowRuleName As String, ByVal mventry As MVEntry, ByVal csentry As CSEntry) Implements IMASynchronization.MapAttributesForExport
' TODO: Add export attribute flow code here
Select Case FlowRuleName
Case "ExportPasswordStr"
Case Else
End Select
End SubDestination MA
Public
Sub MapAttributesForExport(ByVal FlowRuleName As String, ByVal mventry As MVEntry, ByVal csentry As CSEntry) Implements IMASynchronization.MapAttributesForExport
Select Case FlowRuleName
Case "exportNTSecurityDescriptor"
'Assign ntSecurityDescriptor string to set "User cannot change password flag"
Dim sddl As String = "my_ntSecurityDescriptor_string"
csentry(
"ntSecurityDescriptor").BinaryValue = Utils.ConvertStringToSecurityDescriptor(sddl)
Case "ExportPasswordStr"
Try
'If Utils.TransactionProperties("PasswordUpdated").Equals(True) Then
LogMsg(Utils.TransactionProperties.Contains(
"PasswordUpdated").ToString)
Dim DB As DBAccess = New DBAccess()
Dim Pass As String = mventry("c_userPasswordStr").Value
csentry(
"unicodepwd").Value = Pass
'End If
Catch ex As Exception
LogMsg(
"ExportPasswordStr Exception:" + ex.Message)
End Try
Case Else
End Select
End Sub
May 22nd, 2009 8:54am