27 October 2014

Verify active directory user and password

Add-Type -AssemblyName System.DirectoryServices.AccountManagement

$context = [System.DirectoryServices.AccountManagement.ContextType]::Domain

$principalc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($context, 'local.intra', 'testuser','pass')

$principalc.ConnectedServer

$principalc.ValidateCredentials('testuser','pass')

16 October 2014

Test if property exist for an object

$user = Get-ADUser username
if($user.PSObject.Properties.Match('SurnameWXZ').Count){'Yes'}
else {'No'}

Use -f formating operator in powershell

syntax for –F format operator is

{<index>[,<alignment>][:<formatString>]}



basic help information is available in powershell: Get-Help about_Operators

a detailed blog post on technet about -f operator.

08 October 2014

The most useful websites and web apps

The Most Useful Websites and Web Apps

ctrlq.org/screenshots – for capturing screenshots of web pages on mobile and desktops.
dictation.io – online voice recognition in the browser itself.
Most Useful Websiteszerodollarmovies.com – find full-length movies on YouTube.
screenr.com – record movies of your desktop and send them straight to YouTube.
goo.gl – shorten long URLs and convert URLs into QR codes.
unfurlr.come – find the original URL that’s hiding behind a short URL.
qClock – find the local time of a city using Google Maps.
copypastecharacter.com – copy special characters that aren’t on your keyboard.
codeacademy.com – the best place to learn coding online.
lovelycharts.com – create flowcharts, network diagrams, sitemaps, etc.
iconfinder.com – find icons of all sizes.
office.com – download templates, clipart and images for your Office documents.
followupthen.com – the easiest way to setup email reminders.
jotti.org – scan any suspicious file or email attachment for viruses.
wolframalpha.com – gets answers directly without searching   – see more wolfram tips.
printwhatyoulike.com – print web pages without the clutter.
ctrlq.save – save online files to Dropbox or Google Drive directly.
ctrql.rss – a search engine for RSS feeds.
e.ggtimer.com – a simple online timer for your daily needs.
coralcdn.org – if a site is down due to heavy traffic, try accessing it through coral CDN.
random.org – pick random numbers, flip coins, and more.
pdfescape.com – lets you can quickly edit PDFs in the browser itself.
tubemogul.com – simultaneously upload videos to YouTube and other video sites.
scr.im – share you email address online without worrying about spam.
spypig.com – now get read receipts for your email.
myfonts.com/WhatTheFont – quickly determine the font name from an image.
google.com/webfonts – a good collection of open source fonts.
regex.info – find data hidden in your photographs – see more EXIF tools.
livestream.com – broadcast events live over the web, including your desktop screen.
iwantmyname.com – helps you search domains across all TLDs.
homestyler.com – design from scratch or re-model your home in 3d.
join.me – share you screen with anyone over the web.
onlineocr.net – recognize text from scanned PDFs – see other OCR tools.
flightstats.com – Track flight status at airports worldwide.
wetransfer.com – for sharing really big files online.
hundredzeros.com – the site lets you download free Kindle books.
polishmywriting.com – check your writing for spelling or grammatical errors.
marker.to – easily highlight the important parts of a web page for sharing.
typewith.me – work on the same document with multiple people.
whichdateworks.com – planning an event? find a date that works for all.
everytimezone.com – a less confusing view of the world time zones.
gtmetrix.com – the perfect tool for measuring your site performance online.
noteflight.com – print music sheets, write your own music online (review).
imo.im – chat with your buddies on Skype, Facebook, Google Talk, etc. from one place.
translate.google.com – translate web pages, PDFs and Office documents.
kleki.com – create paintings and sketches with a wide variety of brushes.
similarsites.com – discover new sites that are similar to what you like already.
wordle.net – quick summarize long pieces of text with tag clouds.
bubbl.us – create mind-maps, brainstorm ideas in the browser.
kuler.adobe.com – get color ideas, also extract colors from photographs.
liveshare.com – share your photos in an album instantly.
lmgtfy.com – when your friends are too lazy to use Google on their own.
midomi.com – when you need to find the name of a song.
google.com/history – see your past searches, also among most important Google URLs
bing.com/images – automatically find perfectly-sized wallpapers for mobiles.
faxzero.com – send an online fax for free – see more fax services.
feedmyinbox.com – get RSS feeds as an email newsletter.
ge.tt – qiuckly send a file to someone, they can even preview it before downloading.
pipebytes.com – transfer files of any size without uploading to a third-party server.
tinychat.com – setup a private chat room in micro-seconds.
privnote.com – create text notes that will self-destruct after being read.
boxoh.com – track the status of any shipment on Google Maps – alternative.
mondrian.io – create vector drawings in the browser
draw.io – create diagrams and flowcharts in the browser, export your drawings to Google Drive and Dropbox.
downforeveryoneorjustme.com – find if your favorite website is offline or not?
ewhois.com – find the other websites of a person with reverse Analytics lookup.
whoishostingthis.com – find the web host of any website.
labnol.org – software tutorials and how-to guides.
disposablewebpage.com – create a temporary web page that self-destruct.
urbandictionary.com – find definitions of slangs and informal words.
seatguru.com – consult this site before choosing a seat for your next flight.
unsplash.com – download images absolutely free.
zoom.it – view very high-resolution images in your browser without scrolling.
scribblemaps.com – create custom Google Maps easily.
alertful.com – quickly setup email reminders for important events.
picmonkey.com – Picnik is offline but PicMonkey is an even better image editor.
formspring.me – you can ask or answer personal questions here.
sumopaint.com – an excellent layer-based online image editor.
snopes.com – find if that email offer you received is real or just another scam.
typingweb.com – master touch-typing with these practice sessions.
mailvu.com – send video emails to anyone using your web cam.
timerime.com – create timelines with audio, video and images.
stupeflix.com – make a movie out of your images, audio and video clips.
safeweb.norton.com – check the trust level of any website.
teuxdeux.com – a beautiful to-do app that looks like your paper dairy.
deadurl.com – you’ll need this when your bookmarked web pages are deleted.
minutes.io – quickly capture effective notes during meetings.
youtube.com/leanback – Watch YouTube channels in TV mode.
youtube.com/disco – quickly create a video playlist of your favorite artist.
talltweets.com – Send tweets longer than 140 characters.
pancake.io – create a free and simple website using your Dropbox account.
builtwith.com – find the technology stack to know everything about a website.
woorank.com – research a website from the SEO perspective.
mixlr.com – broadcast live audio over the web.
radbox.me – bookmark online videos and watch them later (review).
tagmydoc.com – add QR codes to your documents and presentations (review).
notes.io – the easiest way to write short text notes in the browser.
ctrlq.org/html-mail – send rich-text mails to anyone, anonymously.
fiverr.com – hire people to do little things for $5.
otixo.com – easily manage your online files on Dropbox, Google Docs, etc.
ifttt.com – create a connection between all your online accounts.
Changelog and Updates

The following websites were part of the original list but they are either no longer available or have been replaced with better alternatives.

virustotal.com – scan any suspicious file or email attachment for viruses.
isnsfw.com – when you wish to share a NSFW page but with a warning.
truveo.com – the best place for searching web videos.
tabbloid.com – your favorite blogs delivered as PDFs.
warrick.cs.odu.edu – you’ll need this when your bookmarked web pages are deleted.
tempalias.com – generate temporary email aliases, better than disposable email.
whisperbot.com – send an email without using your own account.
errorlevelanalysis.com – find whether a photo is real or a photoshopped one.
google.com/dictionary – get word meanings, pronunciations and usage examples.
wobzip.org – unzip your compressed files online.
namemytune.com – when you need to find the name of a song.
snapask.com – use email on your phone to find sports scores, read Wikipedia, etc.
pastebin.com – the site has been blocked in India.
encrypted.google.com – Google now redirects all logged-in users to the https version of google.com by default so this is no longer necessary.
bounceapp.com – replace this with a version that works on mobile.

How to repair WMI classes on Windows 2003

1. Open a command prompt.
2. Disable Windows Management Instrumentation service
sc config winmgmt start= disabled
3. Stop Windows Management Instrumentation service
net stop winmgmt
4. Change the current folder to %windir%\system32\webm
cd %windir%\system32\wbem
5. Register all WBEM dlls:
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
6. Run the following command:
regsvr32 %windir%\system32\tscfgwmi.dll
7. Add all classes and class instances to the WMI repository:
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s
8. Register provider host:
wmiprvse /regserver
9. Register WBEM Server (WMI Service)
winmgmt /regserver
10. Run the following two commands:
winmgmt /clearadap

winmgmt /resyncperf


source

02 October 2014

Restore active directory object

it only works if:

  • forest functional level is 2008 R2 (only if all domain controllers are running Windows 2008 R2)
  • Active Directory Recycle Bin was enabled before the object was deleted.


Get-ADObject -Filter {samaccountname -like '*marius*'} -IncludeDeletedObjects -Server adc | Restore-ADObject -PassThru

How to filter for null values with Get-ADUser cmdlet


Get-ADUser -Filter {title -notlike "*"}