none
Granfeldt PowerShell MA. How to delta import? RRS feed

  • Question

  • # Granfeldt PowerShell MA - how to delta import

    Hi,
    How can I do delta import for e.g. Lync MA? The import is using
    get-aduser or get-csaduser as base for the objects population.


    GH


    • Edited by Guy Horn Tuesday, September 22, 2015 8:44 AM
    Tuesday, September 22, 2015 8:43 AM

Answers

  • Looks neat. Just make sure that the highestCommitedUSN is actually the highest. Not sure, but think this value could change between Domain Controllers (although, I seem to recall something about each DC updating the RootDSE object with this and related its own highest USN number to this number). Not sure, though, and I dont have a test environment with more than one DC currently.

    But woth looking into using the above script. I'll have to look into that.

    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

    • Marked as answer by Guy Horn Thursday, October 8, 2015 10:00 AM
    Thursday, October 8, 2015 8:46 AM

All replies

  • Hello Guy

    you can not do that with These cmdlets, you will Need to calculate the Delta by yourself before.

    /Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    Tuesday, September 22, 2015 8:57 AM
  • I sometimes use AD to find changed objects to do this for large implementations (also for Exchange). You can apply the same principals with Lync.

    Have a look at the Exchange 2010 sample scripts in the download section on my blog for hints on how to do this http://blog.goverco.com/p/psmadownloads.html


    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

    Tuesday, September 22, 2015 5:31 PM
  • I got that.

    Can I simplify it by just getting all changes from the AD? I can do that easily by getting only the latest USN as described here: https://guyhorn.wordpress.com/2015/06/03/how-to-get-a-user-delta-import-from-a-hugh-ad-using-powershell-get-aduser/

    E.G.

    $newusn = (Get-ADRootDSE).highestCommittedUSN

    $oldusn =(get-content “c:\temp\lastusn.txt”)

    $newusn | out-file “c:\temp\lastusn.txt”

    $adUsers = Get-ADUser`

    -Filter{(name -like “*”) -and(usnChanged -gt $oldusn)} `

    -Properties “usnChanged”`

    -SearchScope Subtree`

    -SearchBase “ou=_Users,dc=demo,dc=lan”

    And then just running the  if( $results-ne$null) ...foreach loop.

    The reason is that I don't understand enough the cookies and searcher mechanism. I'm sure it works better but I can't maintain it.

    PS" The quotes are messed up. " is not equal to “.


    GH


    • Edited by Guy Horn Friday, October 9, 2015 11:53 AM
    Thursday, October 8, 2015 7:10 AM
  • Looks neat. Just make sure that the highestCommitedUSN is actually the highest. Not sure, but think this value could change between Domain Controllers (although, I seem to recall something about each DC updating the RootDSE object with this and related its own highest USN number to this number). Not sure, though, and I dont have a test environment with more than one DC currently.

    But woth looking into using the above script. I'll have to look into that.

    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

    • Marked as answer by Guy Horn Thursday, October 8, 2015 10:00 AM
    Thursday, October 8, 2015 8:46 AM
  • Thanks! I just tested it and it works fine. Actually it might perform better because the attribute usnChanged is already indexed. The quotes in the sample script above are messed up as usual. " is not equal to “.

    • Edited by Guy Horn Friday, October 9, 2015 11:52 AM
    Thursday, October 8, 2015 10:01 AM