Month: December 2014

LinkedIn – Filters – Pulse/Recommended Jobs and more.

After the layouts changed completely for LinkedIn and Ad Block Plus I had another look at my filter list, which did change significantly. So I’ve added a few extra lines to the filter, which removes some more sponsored links, as well as the job section to the right. Yet again a slimmer feed.

The filter list is a lot more easy to work with in a text editor like notepad. Just copy out your complete custom filter list, add the below and copy it back in and save.

linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored is-sponsored feed-s-update--share share-update video ember-view"]
linkedin.com##[class="f17x700 ad-hdr iframe-ad ns has-ad-label"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored is-sponsored feed-s-update--share share-update image feed-s-update--is-sponsored-image ember-view"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-lynda-update feed-s-update--lynda lynda-update ember-view"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored is-sponsored feed-s-update--share share-update article ember-view"]
linkedin.com##[class="ad-hdr-2b"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored feed-s-update--share share-update image feed-s-update--is-sponsored-image ember-view"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored feed-s-update--share share-update article ember-view"]
linkedin.com##[class="feed-s-update mh0 Elevation-2dp relative lynda-update feed-s-update--lynda lynda-update ember-view"]
linkedin.com##LI[class="feed-update company-recommend-job-digest  has-snippets"]
linkedin.com##LI[class="feed-s-update mh0 Elevation-2dp relative feed-s-update--is-sponsored is-sponsored feed-s-update--share share-update article feed-s-update--topbar-hidden ember-view"]
linkedin.com##LI[class="feed-update company-share-article is-sponsored has-snippets"]
linkedin.com##LI[class="feed-update company-recommend-job  has-snippets"]
linkedin.com##LI[class="feed-update pulse-recommend-article-rollup  has-snippets"]
linkedin.com##LI[class="feed-update people-connect-recommend  has-snippets"]
||ekstrabladet.dk/eb-adblocker-usage/add/*
@@|http://www.agame.com/disable-adblocker-instructions|$document
linkedin.com##[class="feed-ad__side ad-banner-container ember-view"]
linkedin.com##[class="feed-follows-module__title display-flex"]
linkedin.com##[class="feed-base-update mh0 Elevation-2dp relative feed-base-update--is-sponsored is-sponsored feed-base-update--share share-update article ember-view"]

Updated 04-01-2018 – Completely rewritten article.

Advertisements

AD User information from member server using Powershell

So I needed to get the userprincipal name from the domain, just to make sure that it was matching what I was expecting. No Powershell modules, no tools to aid besides Read access on the domain from the Domain Users membership. So how to pull that off?
A lot of long lined scripts, except for one. I took that and edited a few things from it and was able to get exactly what I needed, within a few simple lines. Also reusing the comment from Mattias R. Jessen in one of my previous posts.

$Username = 'jesper.arnecke'

#This search will target the domain from Root level. For refines on specific OU's, use the references.
$Search = New-Object DirectoryServices.DirectorySearcher
#Page size in order to return more than 1000 objects per query.
$Search.PageSize = 1000
#Filter definition
$Search.filter = "(&(objectCategory=person)(SAMAccountname=$Username))"
#Defines the search scope depth. Available choices are "Base", "OneLevel" and "Subtree"(Default value), 
$objSearcher.SearchScope = "Subtree"

Foreach($result in $Search.Findall()){
$user = $result.GetDirectoryEntry()
$user.userprincipalname
}

References:
http://www.kli.dk/2008/09/17/166
https://jesperarnecke.wordpress.com/2013/05/14/get-a-domain-controller-from-any-domain-member/comment-page-1/#comment-23
https://technet.microsoft.com/en-us/library/ff730967.aspx

Updated
16-September-2015: Added more comments, properties and comments. Added additional reference.

Eat the cookie! – ADFS – Powershell

So tired of getting problems with ADFS cookies, so decided to find an easier way than IE to clear my local cookies using a script. This script works on Windows 10. The script should work on lower versions of Windows, however cookie extension might be different as well as location of the cookies.

# Location of IE Cookies
$Path = $env:USERPROFILE + "\AppData\Local\Microsoft\Windows\INetCookies"
$Text = '<domain name of cookie>'
$PathArray = @()

# Cookies are stored as .cookie files.
$cookies = Get-ChildItem $Path -Recurse -Force -Filter "*.cookie" 
      ForEach($cookie in $cookies)
	{
        $IsCookie=$cookie | Select-String -Pattern $Text
 	$PathArray +=$Iscookie
      	}
$Unique=$PathArray | ForEach-Object {$_.Path} | Get-Unique
$Unique | Remove-Item

Updated 11-June-2018
Improved finding the right cookie.
Change extension from .txt to .cookie