Friday, June 29, 2012

Cleaning up old Windows Drive

Gettings trusted installer errors when trying to delete C:\windows folder
sooo

first tried rename to windows.old incase it a protected folder  - fail
then..
takeown.exe /F D:\windows.old /R /A
icacls "D:\windows.old" /RESET /T /Q /C
rd "D:\Windows.old" /Q /S
or
for /f %i in ('dir /ad /b') do rd %i /s /q


Machine Password

Text file with list of servers WindowsServers.txt

Grab the data

$CAITInfo = Get-Content .\CAITWindowsServers.txt | Foreach {get-adcomputer $_ -properties PasswordLastSet}

Filter and display
$CAITInfo | Sort-Object -descending PasswordLastSet | FT -property DNSHostname,PasswordLastSet

Grab Older than 30 days... which means either problem? or machine password not updating..
$CAITInfo | Sort-Object -descending PasswordLastSet|Where { $_.PasswordLastSet -lt (Get-Date).AddDays(-30)} |
FT -property DNSHostname,PasswordLastSet

To force a PC\server to reset machine password to AD (where not a DC)
nltest.exe /sc_change_pwd:lc.local

wonder if I can do that via powershell :)


Tuesday, June 5, 2012

File Server Error - Windows 8 / windows 2012

While using windows 8 or Windows 2012 was getting Extended Error Connecting to NAS or system error 2148073478 or  ("an extended error has occurred")

Soltuion
Reduce workstation security so that can access NAS, linux file server, etc

HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
REG_DWORD  RequireSecureNegotiate = 0