Get username and domain of Foreign Security Principal from domain trust

You can use this code to determine the DOMAIN\username from the Foreign Security Principal which is really the SID of the account. Pass the full distinguishedName of the ForeignSecurityPrincipal. static string GetUserNameOfFSP(string ForeignSecurityPrincipal) { //Returns with syntax of "DOMAIN\logonname" try { DirectoryEntry user = new DirectoryEntry("LDAP://" + ForeignSecurityPrincipal); SecurityIdentifier sid = new SecurityIdentifier((byte[])user.InvokeGet("objectSid"), 0); NTAccount… Continue reading Get username and domain of Foreign Security Principal from domain trust

Authenticate a user against Active Directory including domain trust

Authenticate a user’s credentials with this code against a domain. This also works with a domain trust. static bool AuthenticateUser(string userName, string password, string domain) { bool authentic = false; try { DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain, userName, password); object nativeObject = entry.NativeObject; authentic = true; } catch (DirectoryServicesCOMException e) { Console.Write(e.Message); }… Continue reading Authenticate a user against Active Directory including domain trust

SharePoint 2010 Alerts – Daylight Savings Time (DST)

  Are your alerts behind or ahead by an hour? Microsoft has created a PowerShell script to automatically update your alerts for daylight savings time. http://technet.microsoft.com/en-us/library/cc508847.aspx You’ll want to make sure you’re running the script as a SharePoint administration from within the SharePoint Management Shell. Add the PowerShell script to the scope . ./Invoke-AlertFixup.ps1 (make… Continue reading SharePoint 2010 Alerts – Daylight Savings Time (DST)

SharePoint 2010: Unable to Display This Web Part. Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.

  This was caused by the XsltTransformTimeout when using an Xslt list view. This is corrected by installing the February 2012 Cumulative Update and by making the following change via PowerShell. Check Current Setting $farm = Get-SPFarm $farm.XsltTransformTimeOut The default setting is 1 second. The PowerShell code below changes it to 5 seconds which should… Continue reading SharePoint 2010: Unable to Display This Web Part. Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.

OABGen will skip user entry…SMTP address is invalid

  Receiving an error message on your mailbox server… Source:      MSExchangeSA Event ID:    9325, 9320, 9327 Message:   OABGen will skip user entry ‘Display Name’ in address list ‘\Address List’ because SMPT address ‘’ is invalid. This was happening on my server, however the names that were shown didn’t have mailboxes. This is how I fixed… Continue reading OABGen will skip user entry…SMTP address is invalid

Trend Micro OfficeScan–Manual UnInstall–Automated

Recently I’ve been having issues on a few workstations where the Trend Micro OfficeScan installation became corrupt. Attempting to re-install OfficeScan again would result in an error message saying it was already installed. All the tools that Trend Micro provided wouldn’t remove the remnants. Trend does offer a manual uninstallation method (http://esupport.trendmicro.com/solution/en-us/1039283.aspx), but takes too… Continue reading Trend Micro OfficeScan–Manual UnInstall–Automated

Outlook Social Connector–Missing GAL Photo

  If your Outlook Social Connector is missing photos for contacts that are in the global address list, it could be because OSC is looking at your personal contacts. To force it to look at the GAL for the photo, set this registry key.   HKCU\Software\Microsoft\Office\14.0\Outlook Create DWORD PreferADPhotos with decimal value 1

WindowsIdentity Impersonation – An attempt was made to reference a token that does not exist

  Was working on a ASP.NET app to impersonate a domain user to access a network resource and came across the error “An attempt was made to reference a token that does not exist”. When defining the domain for the following function, make sure it is in the FQDN format. domain.com and not DC=domain,DC=com  private… Continue reading WindowsIdentity Impersonation – An attempt was made to reference a token that does not exist

Published
Categorized as ASP.NET, C#

Schedule Update-SPProfilePhotoStore

  Create a PowerShell script with the following. Make sure your MySite host location is correct. Add-PSSnapin Microsoft.SharePoint.PowerShell Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysitehostlocation/MySite/ Save the file as a .ps1 file on your SharePoint 2010 server – C:\Scripts\UpdateSPPhotos.ps1 Create a daily scheduled task on the SharePoint 2010 server that runs at the SharePoint Farm Administrator account.… Continue reading Schedule Update-SPProfilePhotoStore