Tags

Howto (51) Free Software (35) Powershell (33) Windows Server (23) AD (16) Hyper-V (16) Exchange (13) Office (13) Group Policy (10) Windows Server 2012 (9) Scripts (7) Symantec BE (5) Windows 8 (5) Cisco (4) TMG (4) Terminal Server (4) Cluster (3) HP (3) RDS (3) UAG (3) Citrix (2) DC (2) DNS (2) IE10 (2) OpenID (2) PKI (2) SCVMM (2) Windows Live (2) iLO (2) Backup (1) DPM (1) Fileserver (1) IE (1) SQL; DPM (1) Security (1) Sharepoint (1) Switch (1) VMWare (1) Veeam (1)

dinsdag 25 november 2014

MSTSC security

Standaard zal mstsc in private modus opstarten waarbij wachtwoorden en bitmaps gecached worden.
Er zijn tooltjes op Internet te vinden die die cache dan (enigszins) kunnen uitlezen.
 
Als je dus eventueel vanuit een Internetcafe, hotel of andere werkplek mstsc gebruikt doe dat dan als volgt:
 
     mstsc /v:123.32.23.23:3389 /public
 

zondag 16 november 2014

Explorer shell integratie Notepad++ verwijderen

 
 
Notepad++ verwijderen uit de shell:
 
regsvr32 /u NppShell_06.dll
 
Notepad++ weer aan de shell toevoegen:
 
regsvr32 /i NppShell_06.dll
 
 

As an Administrator you still get the message "You don't currently have permission to access this folder"

Onderstaande popup krijgen we op Windows 2012 R2 Servers op mappen waar we als Domain Admin wel rechten op hebben.
 
 
De melding wordt veroorzaakt door de UAC.
Nu kun je de UAC in zijn geheel uitschakelen (reboot required), maar er is een iets mooiere manier.
Je kunt namelijk bepaalde aspecten van de UAC uitzetten welke bovenstaande melding veroorzaken.
 
Dit kun je lokaal op de server instellen, echter is het mooier om een aparte GPO hiervoor aan te maken.
 
 
Zie ook:
 

dinsdag 21 oktober 2014

Kopieren van bestanden vanuit "Previous Versions" gaat fout vanwege te lange bestandsnamen

Het kan zijn dat de bestandsnamen te lang zijn als je vanuit “Previous Versions” (aka Vorige Versies) bestanden wilt kopiëren.

Je krijgt dan onderstaande melding:


Het grootste probleem daarbij is dat de kopieer opdracht dan niet verder gaat, maar wordt afgebroken.
Erg vervelend als je 1 TB aan data aan het kopiëren bent en na 600 GB de kopieerslag wordt afgebroken door één enkel bestand met een te lange bestandsnaam.

Met wat trial and error, tot de volgende oplossing gekomen.

Open de gewenste “Previous Version”:



Klik in de titlebar en je ziet iets in de trant van onderstaand pad staan, eindigend op “(Friday, October 17, 2014, 6:14 PM)”
Dat is een pad naam dat je niet kunt gebruiken in je DOS commando.


Als je echter in de titlebar op het hoogste niveau klikt waar de datum achter staat, dan krijg je een pad te zien dat eindigt op “@GMT-2014.10.17-16.14.34”, iets wat wel gaat werken.




Creeer met dat laatste pad een symbolic link met een korte naam:

                Mklink /d c:\s \\DPM-server.domein.local\Fileserver.domein.local_share$\@GMT-2014.10.17-16.14.34

Nu kun je met Robocopy een complete kopie maken van de betreffende map zonder dat de kopieslag afgebroken wordt.
In mijn geval schrijf ik iig een log bestand weg, zodat ik kan kijken of er nog bestanden zijn die niet gekopieerd worden.


Symbolic links kun je zien door met DIR de mappen op te vragen.
Na de kopieslag kun je de symolic link verwijderen met:

                Rmdir c:\s





Install Win 8.1 from USB Stick

Configure External Time Source on Primary Domain Controller


Om te zien welke server de dc is:

netdom /query fsmo

Dan op de PDC onderstaande commando’s uit voeren:

w32tm.exe /config /manualpeerlist:”0.nl.pool.ntp.org 1.nl.pool.ntp.org 2.nl.pool.ntp.org 3.nl.pool.ntp.org” /syncfromflags:manual /reliable:YES /update

w32tm.exe /config /update

Restart-Service w32time

Wachtwoord reset van Cisco 800 router

De router met een console kabel verbinden met een terminal of PC.

Tijdens het opstarten van de router het break commando “CTRL-SHIFT-6-X” uitvoeren om de router in ROMMON mode te zetten.

Type commando “set” om de gegevens te bekijken van ios-conf
Deze variabele zet de waarde van het configuratie register.

Type “set ios-conf = 142” en vervolgens “boot”.

De router start nu op en je kunt zonder wachtwoord naar de “enable” modus.
Type daar “configure memory” of “copy startup-config running-config” in een kopie van de configuratie naar het geheugen weg te schrijven.

Je kunt nu de configuratie bekijken “show running-config”




Toetsenbordindeling



When talking about keyboard layouts, the terms ANSI and ISO refer to the two main classes of Western keyboard layouts. The terms ANSI and ISO literally refer to the American National Standards Institute and International Organization for Standardization respectively. ANSI and ISO are physical layouts, i.e. they describe the size and position of the keys regardless of the logical layout (US QWERTY, UK QWERTY, German QWERTZ, Colemak, Windows vs Macintosh etc). Japan has its own keyboard layout, JIS, similar to ISO, but with three additional keys. The terms "ANSI" and "ISO" are also used, perhaps erroneously, to describe keyboards with a "big-ass" enter key, i.e. an enter key that consumes the union of the space occupied by both the ISO and ANSI return keys.

ANSI

ANSI layout keyboards are used in the United States and the Netherlands amongst other countries. PC keyboards using the ANSI layout as used by the IBM Model M are typically referred to as 101-key (pre-1995), 104-key (with the Windows and context menu keys added), and 87-key (standard tenkeyless layout). The main cluster of keys is laid out thus:
The pink and purple keys illustrate the keys that differ from ISO.

ISO

ISO keyboards are used by many European countries, and with one extra key compared to ANSI keyboards, are correspondingly referred to as 102-key, 105-key and 88-key for PCs.
The pink and purple keys illustrate the keys that differ from ANSI. In addition to having one extra key, the ISO layout has another fundamental property: the right Alt key is replaced with the Alt Gr key, which is a typographic meta key that accesses the third symbol on a keyboard. The use of accents in European languages leads to the need to enter many more symbols than in the US, with keys having increased symbol overloading. For example, in the UK, the "4" key will produce "$" with the Shift key held, and "€" with the Alt Gr key held.

Uitleg PS Execution Policy

In de GPO WinRM had ik tijdelijk even een setting toegevoegd, welke ervoor zorgt dat alle server die deze policy krijgt de Execution policy ingesteld wordt op “Allow only signed scripts”.
Op een server die deze policy nu krijgt zie je bij “Get-ExecutionPolicy – list” dat de scope “MachinePolicy” op AllSigned staat.
De MachinePolicy wordt gezet door de GPO en gaat boven alle andere scopes.
Het is daardoor niet mogelijk zoals je hieronder ziet om de executionpolicy op het systeem zelf aan te passen.
Via de Get-Help zie je dat je de ExecutionPolicy een aantal waardes kunt instellen:
Valid values are:               
-- Restricted: Does not load configuration files or run scripts. "Restricted" is the default.                
-- AllSigned: Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.               
-- RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.               
-- Unrestricted: Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.                
-- Bypass: Nothing is blocked and there are no warnings or prompts.               
-- Undefined: Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.
Stel NOOIT maar dan ook NOOIT de Executionpolicy in op Unrestricted (en zeker niet op Bypass), de minimale setting moet zijn RemoteSigned!
Lokale scripts worden dan gewoon uitgevoerd, echter scripts die gedownload zijn niet (of ze moeten gesigned zijn).
Windows kan via de ADS (NTFS Alternative DataStream) zien of een bestand gedownload is of niet.

Powershell and external commands done right




Dus onderstaand commando is correct in powershell:

robocopy "\`"$sourceFolder"\`" "\`"$destinationFolder"\`" /MIR

Korte uitleg van omzetten binary naar decimaal naar ASCII

they are binary code.

01001001 = 64 + 8 + 1 = 73 in decimal format.
in ASCII 73 = "I"

01010100 = 64 + 16 + 4 = 84 in decimal format.
in ASCII 84 = "T"

decimal decoding is pretty simple the last digit is 1, the next to the left is 2, and it doubles each one to the left.

128, 64, 32, 16, 8, 4, 2, 1

if it is a 1, you add the number for the place, if it is a 0 you do not.

just like the decimal system, only we use 10.

..., 10000, 1000, 100, 10, 1

8 bits (1's and 0's) are a byte, and bytes are used for characters, which is why everyone is guessing letters, but it could just as easily be the numbers that are stored there.

On this table you can find all the ascii letter listed with their decimal equivalent.

http://www.asciitable.com/

Verschillen tussen HP ML380p en ML380e servers

Major differences:
  • 380e has max RAM of 384GB in 12 DIMMs vs 380p max RAM of 768GB in 18 DIMMs
  • 380e has a 2 rear drive chassis option so it can support max of 14 LFF/27 SFF vs 12LFF/25SFF in the 380p
  • 380e uses Xeon E5-2400 series processors and 380p uses E5-2500 processors with the 380p having higher clock speeds available
  • 380e comes with a 3/1/1 warranty standard vs 380p with 3/3/3 warranty standard
  • 380e has entry level on-board RAID controllers B120i and B320i depending on model vs the 380p with a P420i on-board

donderdag 24 juli 2014

Tip - Syntax Powershell highlighting toevoegen aan je Blog


 Deze fantastische tip, kwam ik tegen op het blog van DexterPOSH, zie ook:

http://dexterposh.blogspot.in/2014/06/tip-add-syntax-highlighting-for.html

Je moet de Powershell module "Copy to Colorized HTML" downloaden van:

http://en.community.dell.com/techcenter/powergui/m/script-add-ons/20439006.aspx

Vervolgens voeg je onderstaande code toe aan je ISE Profile (Microsoft.PowerShellISE_profile.ps1)

001
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add(“Copy As Colorized HTML”,{Copy-ColorizedHTML},“Ctrl+Shift+C”)

Daarna kun je vanuit de ISE code naar HTML kopieren d.m.v. CTRL+SHIFT+C of vanuit het Add-ons menu.

Je hoeft daarna alleen nog maar de code te plakken in een nieuw blogger bericht en het kader eventueel wat verkleinen zodat het netjes op je blog terecht komt.

Export-FileStructure to CSV


Ik gebruik onderstaand script om de bestandsstructuur van een Powershell project in kaart te brengen, als onderdeel van de documentatie.

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
<#
.SYNOPSIS
   A CSV file will be created, which can be used for documentation i.a.
.DESCRIPTION
   Write log line into configured logfile. Set logfile in settings: Settings.Logfile.
.EXAMPLE
   Export-FileTree2CSV -Path "C:\Temp" -ExportFile test.csv -NumberOfLevelsDeep 10
.EXAMPLE
   Export-FileTree2CSV -Path "C:\Temp" -ExportFile 'C:\Test\test.csv'
.NOTES
   Written by Stein Salfischberger
#>

Function Export-FileTree2CSV
{
    [CmdletBinding()]
    Param (
# Geef hier de directory op welke je gedocumenteerd wilt hebben
        [Parameter(Mandatory=$True)][string] $Path
, # Geef hier de bestandsnaam (eventueel het gehele path) op van het te exporteren bestand (csv)
        [Parameter(Mandatory=$False)][string] $ExportFile = '..\tijdelijk\AckssPSFileStructure.csv'
, # Geen hier een getal op (integer) van het aantal niveaus diep
[Parameter(Mandatory=$False)][int] $NumberOfLevelsDeep = 10
    )

Get-ChildItem -Recurse -Path $Path | 
    ForEach-Object { $OutputRow = [ordered]@{ 0 = $_.PSIsContainer }; 
    $Elements = $_.FullName.Split('\'); 
    ForEach($Index in 1..$NumberOfLevelsDeep) { $OutputRow[[string]$Index] = $Elements[$Index] }; 
    New-Object PSCustomObject -Property $OutputRow } | 
    Export-Csv -Path $ExportFile -UseCulture -NoTypeInformation
}

vrijdag 27 juni 2014

Eliminate UAC Prompts for specific applications

Als voorbeeld zal ik “FAR Manager” in elevated mode (als Administrator) opstarten zonder een melding te krijgen van Gebruikersaccountbeheer (UAC).
 
STAP 1: Maak een taak aan
  • Open de Windows Taakplanner (Task Scheduler -  “taskschd.msc”)
  • Maak een nieuwe map aan, bijvoorbeeld “UAC Whitelist”
  • Maak in die map een nieuwe taak aan (geen basistaak)
  • Selecteer “Met meeste bevoegdheden uitvoeren”
  • Selecteer onder “Configureren voor:” het juiste OS
  • Op tabblad “Acties” maak je de actie “Programma starten” aan, welke de exe start van het betreffende programma.
  • Op tabblad “Voorwaarden”, deselecteer  “De taak alleen starten als de computer op netstroom werkt”.
Hieronder wat screenshots:
 
 
 
 
STAP 2: Maak een snelkoppeling aan naar de betreffende taak
 
Nu hoef je alleen nog een snelkoppeling te maken naar deze taak:
 
C:\Windows\System32\schtasks.exe /RUN /TN "UAC Whitelist\FAR Manager Elevated"
 
 
Zie ook:
 
 

dinsdag 7 januari 2014

Opschonen van Windows Updates

Je kunt de Windows Server 2012 (R2) en Windows 8(.1) Updates opschonen door de Disk Cleanup te starten:
 
(let wel dat je voor Windows Server 2012 en Windows 8 minimaal op SP1 moet zitten)
 
WinSxS voor de Cleanup:
 
 
De Disk Cleanup:
 
 
WinSxS na de Cleanup:
 
 
 
 

Ik kan geen pagina's meer openen in Internet Explorer na update Windows 8.1

 
Ik kan geen pagina's meer openen in Internet Explorer na update Windows 8.1:
 
Bij Internetopties even de bovenste optie inschakelen:
 
“64-bits processen inschakelen voor de uitgebreide beveiligde modus”:
 
 

Meerdere ip-adressen op 1 nic

Je kunt wat problemen krijgen bij het toevoegen van een tweede ip-adres aan een nic.
 
Standaard is het zo dat niet het eerste ip-adres dat aan een nic gekoppeld zit als source ip-adres wordt beschouwd maar het ip-adres met het laagste numerieke ip-adres.
 
Stel je hebt een Exchange server met ip-adres 10.240.4.179. Dit ip-adres wordt geregistreerd in de DNS en de server gebruikt dit ip-adres als source. Je hebt zodat de PTR lookup overeenkomt vervolgens voor uitgaand SMTP verkeer een NAT regel toegevoegd dat dit ip-adres mapped naar een publiek ip-adres.
Nu wil je vanwege een extra receive connector het vrije extra ip-adres 10.240.4.154 toevoegen aan de netwerkkaart.
 
Je hebt nu een tweetal problemen gecreëerd:
  1. Je hebt indien dynamic registration aan staat nu twee ip-adressen geregistreerd voor dezelfde server
  2. Je server zal nu al het uitgaand verkeer versturen vanaf 10.240.4.154, omdat 154 lager is als 179
  
Zetten van SkipAsSource flag:
 
Je kunt dit voorkomen door SkipAsSource bij het toevoegen van het ip-adres op True zetten:
 
Dit kan met netsh maar ook natuurlijk met Powershell:
 
netsh int ipv4 add address "Ethernet" 10.240.4.154/24 SkipAsSource=true
 
of
 
New-NetIPAddress –IPAddress 10.240.4.154 –InterfaceAlias “Ethernet” –SkipAsSource $True
 

Achteraf kun je deze zetten door onderstaand Powershell commando uit te voeren:

Set-NetIPAddress -IPAddress 10.2.102.75 -SkipAsSource $True
 
De SkipAsSource flag doet twee dingen:
  1. Het zorgt ervoor dat Windows het IP adres niet als source IP adres gebruikt voor uitgaand verkeer
  2. Het voorkomt dat het IP adres geregistreerd wordt in DNS als dynamic registration aan staat
 
 
Controle: Status van de SkipAsSource flag
 
 
 
Links:
 
Source IP address selection on a multi-homed Windows Computer:
 
 
 
SkipAsSource Flag Cleared in Windows Server 2012: