UEFI USB Stick boot

uefi

 

 

 

 

 

 

Diskpart
clean
convert gpt (Vet ej om detta steg behövs…)
create partition primary
format fs=fat32 quick
active
assign
exit

bootsect /nt60 X:

copy efi\microsoft\boot upp en nivå… (hela mappen)
Öppna kopiera (öppna med 7-zip) sources\install.wim\1\windows\boot\efi\bootmgfw.efi och lägg den i efi/boot
Döp om bootmgfw.efi till bootx64.efi

Förhindra att man bootar på fel..

 

  • Boot in UEFI mode: To prevent Windows PE from booting in BIOS mode, remove the bootmgr file on the root of the media.
  • Boot in BIOS mode: To prevent Windows PE from booting in UEFI mode, remove the efi folder on the root of the media.

 

 


	

GUI or NOT 2012

Windows Server 2012 guide to add GUI when only core is installed

 

Get-ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Get-WindowsImage -ImagePath <path to wim>\install.wim
Ger instance number of the image we want to get files7parts from…
Example: Get-WindowsImage -ImagePath D:\sources\install.Wim

Install-WindowsFeature Server-GUI-Mgmt-Infra,Server-GUI-Shell -Restart -Source wim:D:\sources\install.wim:2
inställs GUI on a server with just console…

 

REMOVE GUI

DONOTE ! Demands a couple of restarts

Uninstall-WindowsFeature Server-Gui-Shell -Restart
Uninstall-WindowsFeature Server-Gui-Shell -Remove -Restart

 

 

 

 

 

Troubleshoot windows logon

Turn on Verbose Logon – so you can see what windows is doing on startup ….
1. Open regedit and goto: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ Policies\System
2. In right-side pane create/modify DWORD value VerboseStatus and set its value to:

0 – To Disable Verbose Status Message
1 – To Enable Verbose Status Message

Window7 regs below
VerboseLogon_OFF.reg
VerboseLogon_ON.reg

 

Time sync

# NTP Servers finns här om man önskar fler https://www.pool.ntp.org/zone/se Standard: se.pool.ntp.org

W32tm /register
w32tm /config /manualpeerlist:se.pool.ntp.org /syncfromflags:MANUAL
w32tm /config /update
w32tm /resync

W32tm /query /configuration

https://technet.microsoft.com/en-us/library/cc784553(WS.10).aspx

Live migrate Virtualmachines in 2 node cluster

## Live migrates all VM from 001cs to 002cs

$groups = Get-ClusterNode 001cs | Get-ClusterGroup | ?{ $_ | Get-ClusterResource | ?{ $_.ResourceType -like ”Virtual Machine” } }
foreach ( $group in $groups ) { $group | Move-ClusterVirtualMachineRole -Node 002CS }

Windows Debugging

To use the Microsoft Symbol Server
  1. Make sure you have installed the latest version of Debugging Tools for Windows.
  2. Start a debugging session.
  3. Decide where to store the downloaded symbols (the ”downstream store”). This can be a local drive or a UNC path.
  4. Set the debugger symbol path as follows, substituting your downstream store path for DownstreamStore.
    SRV*DownstreamStore*https://msdl.microsoft.com/download/symbols

Windows Image Clean up – DISM

Renas ut gamla uppdateringar i WinSxS folder på olika Windows varianter…


Windows 7 – 2008 R2

%windir%\system32\dism.exe /Online /Cleanup-Image /spsuperseded


Windows 8.1 – 2012 R2

Dism.exe /online /Cleanup-Image /StartComponentCleanup
(Tog 2014-04-13cirka 40 min att köra på min Win8.1 I7 ResultatFöre: 23.4 GB Efter: 21.3 2Gb of data removed 🙂 )

Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
”All existing service packs and updates cannot be uninstalled after this command is completed.”
(Tog 2014-04-13 10 min på min 2012 R2… Resultat Före:14.9 GB Efter: 14.6 … not so big deal…)

Dism.exe /online /Cleanup-Image /SPSuperseded
Tar bort möjligheten till att avinstallera ett Service pack… om något sådan nu finns…


Rättigheter och Owners ICACLS

Ibland är det problem med rättigheter på kunders mappar etc.
Har länge behövt ett smidigt sätt att resetta detta enkelt.
Så här kommer en början…

rem Ger admin owner rättigheter i mappen och undermapparna
set p=”c:\Windows\servicing\Version”
takeown.exe /f %p% /R /A
icacls.exe %p% /grant:r administrators:(oi)(ci)f /t

AD Addon 2003

acctinfo.dll är ett addon för 2003 servers. Visar ”MER” info på User kontot som Login tider m.m. rätt bra 🙂

Accinfo2.dll är otestad men skall tydligen fungera på x64 servers…

2008r2 version ACCTINFO2_64BIT2003 version acctinfo_2003_x86