Setting accountExpires using codeless provisioning
Hi
can someone point out how to convert a string in form of "2010/31/12" in the required integer format to be able to set accountExpires attribute in Active Directory?

Thanks in advance
Henry
November 2nd, 2009 12:54pm

Sorry but for this you'll have to create a custom workflow activity and in that one you could simply use the DateTime.ToFileTime Method.
The AD accountExpire attribute is a FileTime structure (8 byte) and a not easily converted to and from without the right tools and the limited sync rule functions are not the right tools to use...

This would have been a perfect candidate (together with it's sister FromFileTime) for a custom sync rule function but since there isn't anything like that (yet) we have to fall back on workflow. If you read this and think custom sync rule functions could be nice to have, head on to Connect and give this feature request a vote!

//Henrik
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2009 3:18pm

Thanks a lot for your answer and explanation (as well as for the other one concerning the manager attribute).
But isn't it much simpler to go one step back and use the MIIS / ILM - style attribute export flow?
(At least until such commonly usedfeatures are not usable in the portal out of the box)

Henry
November 2nd, 2009 3:40pm

Legacy sync rules or workflow is your choice... In this case I wanted to point out that declarative provisioning isn't complete without custom functions.

//Henrik

Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2009 3:45pm

no, no
everything is perfect. I am very happy with your answer.
Henry
November 2nd, 2009 3:49pm

But remember for your other question (Setting Manager attribute in FIM) you would have to use the Utils.FindMVEntries method to find your manager when using legacy sync rules and that's probably not a good practice because it's slooooow!
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2009 3:53pm

How about an example, maybe some screenshots?
January 19th, 2012 1:04pm

 

Here is a screen
shot of setting the Account Expires Attribute in AD when the EmployeeEndDate
Attribute is set in the FIM Portal. This is done via the FIM WAL using the
Powershell Workflow

 

 

Script

 

Param($User,$Date)

Import-Module ActiveDirectory

Set-ADUser -Identity $User -AccountExpirationDate
([datetime][string]($Date))

return "Success"


Free Windows Admin Tool Kit Click here and download it now
July 24th, 2012 2:08am

 

Here is a screen
shot of setting the Account Expires Attribute in AD when the EmployeeEndDate
Attribute is set in the FIM Portal. This is done via the FIM WAL using the
Powershell Workflow

 

 

Script

 

Param($User,$Date)

Import-Module ActiveDirectory

Set-ADUser -Identity $User -AccountExpirationDate
([datetime][string]($Date))

return "Success"


July 24th, 2012 2:08am

 

Here is a screen
shot of setting the Account Expires Attribute in AD when the EmployeeEndDate
Attribute is set in the FIM Portal. This is done via the FIM WAL using the
Powershell Workflow

 

 

Script

 

Param($User,$Date)

Import-Module ActiveDirectory

Set-ADUser -Identity $User -AccountExpirationDate
([datetime][string]($Date))

return "Success"


What is the FIM WAL?
Free Windows Admin Tool Kit Click here and download it now
February 6th, 2014 10:26pm

this could be done by using a custom workflow activity which is what the FIM WAL is, the FIM WAL is a Custom Workflow Activity that was built and initially deployed by Microsoft Consulting Services "MCS"

There are a number of PowerShell Workflow Activities that have been posted online which could be used to perform this same task. Although the Account Expires activity could be performed completely codeless as far as a rules extension but I would highly recommend using the Rules Extension as it is more efficient, consistent.

an example of the rules extension can be found at my Blog The Connector Space 



April 30th, 2015 8:27am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics