netdom query /domain:dom.local fsmo
Author Archives: Henrik
Powershell mail all files from directory and move them
Get-ChildItem “C:\FilePorts\ValidationPDFs\*” -include *.pdf | foreach { Send-MailMessage -from “from@mail.com” -to “to@mail.com” -subject $_.name -attachments $_.fullname -smtpServer mail.server }
Get-ChildItem “C:\FilePorts\ValidationPDFs\*” -include *.pdf | move-item -destination “C:\FilePorts\ValidationPDFs\printet”
Powershell delete Paused – Spooling print jobs
Deletes Paused – Spooling print jobs that are older than 12 hours
$PrintJobs = get-wmiobject -class "Win32_PrintJob" -namespace “root\CIMV2” -computername . | Where-Object { $_.JobStatus -eq "Paused | Spooling" -and [System.Management.ManagementDateTimeConverter]::ToDateTime($_.TimeSubmitted) -lt $($(Get-Date).addHours(-12))}
foreach ($job in $PrintJobs)
{
Write-Host “Canceling job $($job.JobId)”
Write-Host “Document: $($job.Document)”
Write-Host “Owner: $($job.Owner)”
$job.Delete() }
Plugin for Firefox to download all files on webpage
Powershell script, get locked account from multiple Windows 2008 servers
Param(
[Parameter(Mandatory=$True)]
[string]$Username,
[Parameter(Mandatory=$False)]
[array]$Computers=@(“ad-server1”, “ad-server2”)
)
$Date = [DateTime]::Now.AddDays(-2)
Get-EventLog “Security” -after $Date -computer $Computers | Where-Object { $_.InstanceID -eq 4740 -or $_.InstanceID -eq 4625} | ? { $_.message -match $Username} | fl TimeGenerated, Message
Test SSL certficates
Send mail via VB Script and Telnet
VB Script:
Option explicit
Dim oShell
set oShell= Wscript.CreateObject(“WScript.Shell”)
oShell.Run “telnet”
WScript.Sleep 1000
oShell.Sendkeys “open mail.server 25~”
WScript.Sleep 1000
oShell.Sendkeys “helo test~”
WScript.Sleep 500
oShell.Sendkeys “mail from:from@domain.com~”
WScript.Sleep 500
oShell.Sendkeys “rcpt to:to@domain.com~”
WScript.Sleep 500
oShell.Sendkeys “Data~”
WScript.Sleep 500
oShell.Sendkeys “Subject: Subject for the mail~”
oShell.Sendkeys “From: Sender~”
oShell.Sendkeys “TO: Reciver~”
oShell.Sendkeys “.~”
WScript.Sleep 5000
oShell.Sendkeys “quit~”
Wscript.Quit
Disable browser choice Windows 8
Sticky Notes Keyboard Shortcut
| Ctrl+B | Bold text |
| Ctrl+I | Italic text |
| Ctrl+T | Strikethrough |
| Ctrl+U | Underlined text |
| Ctrl+Shift+L | Bulleted (press once) or Numbered (press twice) list |
| Ctrl+Shift+> | Increased text size |
| Ctrl+Shift+< | Decreased text size |
| Ctrl+A | Select all |
| Ctrl+Shift+A | Toggles all caps |
| Ctrl+L | Left aligns text |
| Ctrl+R | Right aligns text |
| Ctrl+E | Centers text |
| Ctrl+Shift+L | Small Alpha list (3rd), Capital Alpha list (4th), small roman (5th), Capital roman (6th) |
| Ctrl+Scroll Wheel | Increase/Decrease text size |
| Ctrl+1 | Single-space lines |
| Ctrl+2 | Double-space lines |
| Ctrl+5 | Set 1.5-line spacing |
| Ctrl+= | Subscript |
| Ctrl+Shift++ | Superscript |
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+X | Cut |
| Ctrl+C | Copy |
| Ctrl+V | Paste |
| Ctrl+N | New sticky note |

