Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Cannot get inactive Users from SiteUsers property

$
0
0

Hello,

I am using export and import of lists within my sharepoint site collection. and I need to maintain users security like timestamp and author, editor. Since export, import api replaces inactive users(who left organization) by current user I have written PowerShell script to update author and editor field by getting inactive users reference. 

For users who left organization, since they are inactive now, I cannot get these users when I do SiteUsers.GetByID(ID). But I could get reference to these users using Web.EnsureUser(UserName) method since I am using the same site collection.

But today suddenly I am not able to get some users who are inactive using Web.EnsureUser method. If I run my script in other site collection, I could get that inactive user but in one particular site collection I am not able to get that user reference. Anything that I should do to get that user reference? Or any other way to retain inactive user references?

Thanks.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>