13 дек. 2014 г.

Kb3004394 - Windows 7 64bit, Server 2008

Remove it to get windows working.
.\psexec  \\PC  wusa /uninstall /kb:3004394 /quiet /norestart
Rest in peace.

4 дек. 2014 г.

Check number of active rdp users on any server from command line - powershell

Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$computerName
)
net use \\$computerName\c$ /user:Domain\UserName Password| out-null
$Connections=qwinsta /server:$computerName|?{ $_ -match '^\srdp-tcp#' }|?{ $_ -match 'Активно|Active' }|wc -l
Write-host $Connections.trim()
net use \\$computerName\c$ /delete | out-null

17 нояб. 2014 г.

restrict remote registry

regedit
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\
Select “winreg” and click Edit, Select “Permissions”
Select appropriate users/groups

12 нояб. 2014 г.

rsyslog & loganalizer in OpenSUSE

1. Install OpenSUSE. So,I'm installed 13.2 with LXDE.
2. Install rsyslog rsyslog-module-mysql from standard repositories (and remove systemd logger in same time)
3.Install MariaDB, phpMyAdmin, Apache2, mod-php5, php-mysql, php5-gd from standard repositories.
4.Enable apache2, mysql, rsyslog in services.
5. Run "mysqladmin -u root password newpass"

18 окт. 2014 г.

XP и перевод времени в 2014 году

В домене просто создаем GPO, в которой прописываем
1. Ветки реестра с новыми параметрами часового пояса
2. Командный файл для стартапа компьютера, в котором переходим на какой-нибудь левый часовой пояс и потом назад.

14 окт. 2014 г.

WMI Filters for GPO

Select * from WIN32_OperatingSystem where ProductType= 1
- Worstations

Select * from WIN32_OperatingSystem where ProductType>1
- Servers

Select * from Win32_Processor where AddressWidth = '32' ('64')
- It's clear

SELECT OSArchitecture FROM Win32_OperatingSystem where OSArchitecture = "64-bit"
- Same

Select * from WIN32_OperatingSystem where Version like '5.1.%'
- XP & 2003

SELECT * FROM Win32_OperatingSystem where Version = "6.1%" and ProductType = "1"
- Windows 7

SELECT ProductType FROM Win32_OperatingSystem WHERE ProductType = "2"
- domain controllers (1 - AD WS, 3 - member servers)

Select * from win32_computersystem where name= ”WS01” (or name LIKE "WS01*")
- only selected computer(s)

Select * FROM Win32_IP4RouteTable WHERE Destination='0.0.0.0' AND NextHop='10.40.240.254'
- only selected ip subnet


8 окт. 2014 г.

Windows 7 Microsoft DNS server don't register ptr records

Хозяйке на заметку.
В windows 7 и 8 в настройках сетевого адаптера почему-то нужно устанавливать флаг "Use this connection’s DNS suffix in DNS - registration" - "Использовать DNS-суффикс для подключения при регистрации в DNS" для того, чтобы при регистрации машина зарегистрировала себя как в прямой, так и в обратной зоне. В XP этого не нужно - работает и так. Ну и еще надо заставить машину регистрироваться в DNS. И то и другое настраивается через GPO.

Computer Configuration > Policies > Administrative Templates > Network > DNS Client > Register PTR Records и Register DNS records with connection-specific DNS suffix.

Это имеет значение, если DHCP не от Microsoft или он не настроен обновлять записи в DNS.





7 авг. 2014 г.

Exchange хозяйке на заметку

1. Show mailbox size by user

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(KB)";expression={$_.TotalItemSize.Value.ToKB()}},ItemCount

2.Delete disconnected mailbox Exchange

Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

Insert database name and user’s guid into the following command line and press enter

Remove-Mailbox -Database -StoreMailboxIdentity -confirm:$false




24 июл. 2014 г.

runas

runas /user:_ADMINACCT_ "control.exe appwiz.cpl"

Other Options:
Accessibility Controls: control.exe access.cpl
Add Hardware Wizard: control.exe hdwwiz.cpl
Add/Remove Programs: control.exe appwiz.cpl
Administrative Tools: control.exe admintools
Automatic Updates: wuaucpl.cpl
Date and Time Properties: timedate.cpl
Direct X control.exe Panel: directx.cpl
Display Properties (w/Appearance Tab Preselected): control.exe color
Display Properties: control.exe desktop
Display Properties: control.exe desk.cpl
Folders Properties: control.exe folders
Fonts: control.exe fonts
Game Controllers: control.exe joy.cpl
Internet Properties: control.exe inetcpl.cpl
Java control.exe Panel (If Installed): jpicpl32.cpl
Keyboard Properties: control.exe keyboard
Mouse Properties: control.exe main.cpl OR control.exe mouse
Network Connections: control.exe ncpa.cpl OR control.exe netconnections
Network Setup Wizard: control.exe netsetup.cpl
ODBC Data Source Administrator: control.exe odbccp32.cpl
Password Properties: control.exe password.cpl
Phone and Modem Options: control.exe telephon.cpl
Power Configuration: control.exe powercfg.cpl
Printers and Faxes: control.exe printers
Quicktime (If Installed): control.exe QuickTime.cpl
Regional Settings: control.exe intl.cpl
Scanners and Cameras: control.exe sticpl.cpl
Scheduled Tasks: control.exe schedtasks
Screen Saver Panel: control.exe DESK.CPL ,@ScreenSaver
Security Center: control.exe wscui.cpl
Sounds and Audio: control.exe mmsys.cpl
System Properties: control.exe sysdm.cpl
User Account Management: control.exe nusrmgr.cpl
Windows Firewall: control.exe firewall.cpl

NON Control.exe Commands
Date/time applet, Time Zone tab: RUNDLL32 SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,@0,1
Desktop applet, Screensaver tab: RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1
Network applet, Adapters tab: RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,3
Network applet, Protocols tab: RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,2
System applet, Environment tab: RUNDLL32 SHELL32.DLL,Control_RunDLL SYSDM.CPL,@0,2

Elevate Permission to Stop/Restart Services runas /user:_ADMINACCT_ "mmc.exe \"services.msc\""
Shutdown a PC from the Command Prompt runas /user:_ADMINACCT_ "shutdown -s -t 0"
Restart a PC from the Command Prompt runas /user:_ADMINACCT_ "shutdown -r -t 0"
Elevate Permissions to Run Network Admin CMD commands runas /user:domain\_ADMINACCT_ "cmd.exe"
Elevate Permissions to Modify Local Policy runas /user:_ADMINACCT_ "mmc.exe \"gpmc.msc\""
Elevate Permissions to View Security Events runas /user:_ADMINACCT_ "eventvwr.exe"
Elevate Permissions to Manage Network Computers runas /user:domain\_ADMINACCT_ "mmc.exe \"compmgmt.msc\""

23 июл. 2014 г.

ESEUTIL - сжатие ящиков Exchange

Размонтировать базу обязательно.

Командная строка:

eseutil /d "d:\mail\maildb.edb" /p /t "d:\tempbase.edb"

Места должно быть с запасом 200%!

/t - обязательно, если TEMP на системном диске и места на нем не много! Временная база создается в TEMP.
/p - база остается на месте, все сносится во временную, потом ее копируем в исходное размещение.