Menu Home

powershell

Removing SPClaimProvider when File Not Found

Currently I’m working on a project where we are developing a custom claims provider, by inheriting from the SPClaimProvider class and installing it with a farm feature that inherits from SPClaimProviderFeatureReceiver. This worked great until we did some refactoring of the code when moving it from a prototype to production […]

Useful powershell snippets

I just wanted to share a list of useful powershell commands that I use every once in a while, the list will most likely keep growing. I have divided it into two sections one for SharePoint related commands and one for just plain old ps commands. Powershall Commands Add-PSSnapin “Microsoft.SharePoint.Powershell” […]

Assign write/read permissions to Application Event Log to none admin users

The following powershell sniplet can do exactly that. $Account = “ADACCOUNT” #Change this Write-Host Looking up SID for account $Account $AdObj = New-Object System.Security.Principal.NTAccount($Account) $strSID = $AdObj.Translate([System.Security.Principal.SecurityIdentifier]) Write-Host Found SID for account $strSID.Value $w = wevtutil gl application Write-Host $w $channelAccess = $w[5] if ($channelAccess.Contains(“channelAccess:”)) { $str = $channelAccess.Replace(“channelAccess: “,””) […]