title: Sharepoint security based on Active Directory security groups
body: <p>In the organization , we have deployed Sharepoint 2013, to control access to sites decided through security group Active Directory.</p>
  
  <p>Active Directory security groups are added to the site permissions <strong>programmatically</strong>.</p>
  
  <p>Sharepoint 2013 is not updated ( can not read part of the security group Active Directory) security group membership Active Directory, which have been added programmatically checking permissions through the site settings , shows that a new member of the security group no rights and delegated user can not go to the site .</p>
  
  <p><strong>Example:</strong></p>
  
  <p>In the security setting site has been added to the site security group Active Directory, but the members of this group do not get security access rights to the site until the site's security settings do not delete a security group Active Directory, and then add it again , <strong>but in the manual</strong> .</p>
  
  <p>After removing the Active Directory security group of security settings site and then re-adding the same Active Directory security groups to the security settings on the same site <strong>by hand</strong>, members of the Active Directory security groups can access the site.</p>
  
  <p>I searched the internet for similar problems, but all refer to the same solution:</p>
  
  <pre><code>$ sts = Get-SPSecurityTokenServiceConfig
  $ sts.WindowsTokenLifetime = (New-Timespan-Minutes 5 ) &lt;- default 1 hour
  $ sts.LogonTokenCacheExpirationWindow = (New-Timespan-Minutes 2 ) &lt;- default 10 mins
  $ sts.Update ()
  </code></pre>
  
  <p>I applied this solution in itself, but it did not help me .</p>