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

Thursday, May 17, 2012

ISA 2006 vs Cache Log vs liveupdate.liveupdatesymantec.com

So removing the ISA proxy @ work noticed while investigating who is still using the 'old' proxy.  Enable  reporting and the daily report for cache use always says "Information not available"

After thinking about  and then googling for the solution to this, didnt get any joy.

Logically it has to be what is set in the web proxy logging options. I remove a heap reduce the data in logs.
there is a options called 'cache information' , enabled that stuff now just need to wait till tomorrow to see if I have WIN.

reviewed the live log notice that' symatec live updates'   liveupdate.liveupdatesymantec.com are loggin as  cache information = 0x106
http://msdn.microsoft.com/en-us/library/aa503433.aspx


0x00000002 Request includes the IF-MODIFIED-SINCE header.
0x00000004 Request includes one of these headers: CACHE-CONTROL:NO-CACHE or PRAGMA:NO-CACHE.
0x00000100 Request includes the CACHE-CONTROL: MAX-AGE, or CACHE-CONTROL: MAX-STALE, or CACHE-CONTROL: MIN-FRESH header.

not so cool.

Think I need to force caching of this website. off to investigate


Tuesday, April 24, 2012

Powershell - Citrix


load citrix ps adding  :  Add-PSSnapin Citrix.XenApp.Commands

Get the number of sessions in the farm:

$FarmRaw = Get-XAFarm
$FarmRaw.SessionCount

Get the number of sessions per app:

$Sessions = Get-XASession -BrowserName "Notepad"
$SessTotal = $sessions.count

Tuesday, April 3, 2012

Powershell : Active Directory user update and rename in 1 line

# tested and used on powershell v3
# 1 Grab username\password
# 2 Grab all users without admin in the name
# 3  For each user
#     a  Modify display name to include (admin)
#     b  Rename AD object to include (admin)
#
#It’s setup to run in a single line because I can
#
$ninja=Get-Credential ; get-aduser -filter 'name -notlike "*Admin*"' -searchbase 'OU=Security - Administrator Accounts,DC=Coolkids,DC=local' -Properties DistinguishedName | %{set-aduser -credential $ninja $_ -displayname ($_.name + " (Admin)"); rename-ADObject $_.DistinguishedName -credential $ninja -NewName ($_.name + " (Admin)")} 



expanded

#get the admin passwords

$ninja=Get-Credential 
#
get-aduser -filter 'name -notlike "*Admin*"' -searchbase 'OU=Security - Administrator Accounts,DC=Coolkids,DC=local' -Properties DistinguishedName | %{set-aduser -credential $ninja $_ -displayname ($_.name + " (Admin)"); rename-ADObject $_.DistinguishedName -credential $ninja -NewName ($_.name + " (Admin)")} 

Wednesday, March 28, 2012

vhd install windows 8


after downloading the window8 (and converting to usb stick )
Insert and reboot
Follow the installation wizard until you get to the point where to select the partition
Hit Shift + F10 to bring up a Dos prompt window.
Type diskpart and press enter. Then,
DISKPART:>create vdisk file=C:\vhd\win8preview.vhd maximum=20000
DISKPART:>select vdisk file=C:\vhd\win8preview.vhd
DISKPART:>attach vdisk
exit and refresh
choose the new disk, ignore any errors about unable to boot