quinta-feira, 4 de julho de 2013

Group Police (GPO) Através do Registro do Windows

Boa tarde.

Segue abaixo as linhas que eu utilizo para bloquear ou configurar a estação de um usuário através do registro do Windows.

rem Configura o Proxy no Navegador do Usurio (ProxyEnable = 1 Ativa e = 0 Desativa)
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 00000001 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "192.168.1.1:128;192.168.1.1:243;<local>" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d 192.168.1.1:128 /f

rem DESATIVA PAINEL DE CONTROLE 1=Bloqueia 0=Libera

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoControlPanel /t REG_DWORD /d 00000000 /f

rem DESATIVA PENDRIVE E DISPOSITIVO DE ARMAZENAMENTO USB 4=Bloqueia 0=Libera
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /f

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 00000000 /f

rem CONFIGURA WSUS NAS ESTAÇÕES
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate" /v WUServer /t REG_SZ /d http://antivirus /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate" /v WUStatusServer /t REG_SZ /d http://antivirus /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 00000004 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v AutoInstallMinorUpdates /t REG_DWORD /d 00000001 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v DetectionFrequency /t REG_DWORD /d 00000001 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v DetectionFrequencyEnabled /t REG_DWORD /d 00000001 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 00000001 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 00000000 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v RescheduleWaitTime /t REG_DWORD /d 000000012 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v RescheduleWaitTimeEnabled /t REG_DWORD /d 00000001 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v ScheduledInstallDay /t REG_DWORD /d 00000000 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v ScheduledInstallTime /t REG_DWORD /d 000000014 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" /v UseWUServer /t REG_DWORD /d 00000001 /f

rem Bloquear a alterao do Papel de Parede da area de trabalho 1=Bloqueia 0=Libera
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDesktopCleanupWizard /t REG_DWORD /d 0x00000000 /f


rem Remover Menus Personalizados 1=Remove 0=Mantem
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v Intellimenus /t REG_DWORD /d 0x00000001 /f


rem Bloquear Barra de Tarefas 1=Bloqueia 0=Libera
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v LockTaskbar /t REG_DWORD /d 0x00000000 /f

rem Menu Iniciar no estilo Clássico 1="Estilo Classico"
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoSimpleStartMenu /t REG_DWORD /d 0x00000000 /f

rem Acelera o Menu Iniciar 
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v MenuShowDelay /t REG_SZ /d 0 /f
reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v MenuShowDelay /t REG_SZ /d 0 /f

rem Desabilitar a Notificao de Antivrus Desativado 0=Ativa 1=Desativa
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Security Center" /v AntiVirusDisableNotify /t REG_DWORD /d 0x00000001 /f

rem Desabilitar a Notificao de Firewall Desativado Ativa Notificacao=0 | Desativa Notificacao=1
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Security Center" /v FirewallDisableNotify /t REG_DWORD /d 0x00000001 /f

rem Desabilitar a Notificao de Atualizaes Automticas Desativada Desativa Notificacao=1 | Ativa Notificacao=0
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Security Center" /v UpdatesDisableNotify /t REG_DWORD /d 0x00000001 /f

rem Desabilitar Windows Messenger Habilita MSN=0 | Desativa MSN=1
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Messenger\Client" /v PreventRun /t REG_DWORD /d 0x00000001 /f

rem Disable Windows Xp Firewall Ativa Firewall=1 | Desativa Firewall=0 
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Serices\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v EnableFirewall /t REG_DWORD /d 0x00000000 /f

rem Limpa arquivos temporarios do Internet Explorer Limpa Arquivos=0 | Nao Limpa Arquivos=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache" /v Persistent /t REG_DWORD /d 0x00000000 /f

rem Esconde a pagina para configurao de temas Esconde=1 | Nao Esconde=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoThemesTab /t REG_DWORD /d 0x00000000 /f

rem Exibe o botao logoff no menu iniciar  1=Exibe 0=No exibe
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v ForceStartMenuLogoff /t REG_DWORD /d 0x00000001 /f

rem Exibe arquivos ocultos Exibir Arquivos=1 | Ocultar Arquivos=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 0x00000001 /f

rem Bloqueia a alteracao da pagina inicial
rem reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer"
rem reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel"
rem reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel" /v homepage /t REG_DWORD /d 0x00000001 /f

rem Define Papel de Parede
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ConvertedWallpaper /t REG_SZ /d "\\endereco\arquivo.bmp" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v OriginalWallpaper /t REG_SZ /d "\\endereco\arquivo.bmp" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "\\endereco\arquivo.bmp" /f

rem Desativa o Horario de Verao na estacao
rem reg DELETE "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /v DisableAutoDaylightTimeSet /f

rem Desativa a Tour ao Iniciar o Windows pela primeira vez
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Applets\Tour" /v RunCount /t REG_DWORD /d 0x00000000 /f

rem Desativando instalacoes .msi atraves de dispositivos removiveis - Desativa Instalacoes=1 | Ativa Instalacoes=0
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer" /v DisableMedia /t REG_DWORD /d 0x00000000 /f

rem Desativando o Windows Installer - Bloqueia=2 | Libera=0 | AdminOnly = 1
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer" /v DisableMSI /t REG_DWORD /d 0x00000000 /f

rem Ocultacao de icones na barra de tarefas - Mostra Icone=0 | Esconde Icones=1 
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer" /v EnableAutoTray /t REG_DWORD /d 0x00000000 /f

rem Boot automatico apos erro de tela azul - Disativa=0 | Ativa=1
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 0x00000000 /f

rem Hide Gerenciar do Meu Computador - Mantem=0 - Hide=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoManageMyComputerVerb /t REG_DWORD /d 0x00000000 /f

rem Desativando o Botao Direito no Internet Explorer - Desativa Acesso=1 | Ativa Acesso=0
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserContextMenu /t REG_DWORD /d 0x00000000 /f

rem Desativando alteracao no Menu Iniciar - Desativa Alteracoes=1 | Permite Alteracoes=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoChangeStartMenu /t REG_DWORD /d 0x00000000 /f

rem Alterar o nome do responsavel pelo Windows
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v RegisteredOwner /t REG_SZ /d "Minha Empresa" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v RegisteredOrganization /t REG_SZ /d "Minha Empresa" /f

rem Nao deleta impressoras do sistema - Nao permite apagar=1 | Permite Apagar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDeletePrinter /t REG_DWORD /d 0x00000000 /f

rem Nao permite instalar novas impressoras no sistema - Nao permite instalar=1 | Permite Instalar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoAddPrinter /t REG_DWORD /d 0x00000000 /f

rem Esconde o executar do Menu Iniciar - Esconde o Executar=1 | Mostra o Executar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoRun /t REG_DWORD /d 0x00000000 /f

rem Bloqueia alteracao na Barra do Internet Explorer - Bloqueia=1 | Desbloqueia=0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserBars /t REG_DWORD /d 0x00000000 /f

rem Bloqueia Salvar como no Internet Explorer - Bloqueia=1 | Desbloqueia=0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserSaveAs /t REG_DWORD /d 0x00000000 /f

rem Bloqueia Opes de Internet - Bloqueia=1 | Desbloqueia=0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserOptions /t REG_DWORD /d 0x00000000 /f

rem Define a pagina inicial do Internet Explorer
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://www.meusite.com.br" /f

rem Define a pagina de pesquisa do Internet Explorer
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Search Page" /t REG_SZ /d "www.google.com.br" /f

rem Remover as dicas dos bales nos itens do "Menu Iniciar" 
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoSMBalloonTip /t REG_DWORD /d 0x00000001 /f

rem Bloquear o Gerenciador de Tarefas - Bloquear=1 | Liberar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /t REG_DWORD /d 0x00000000 /f

rem Bloqueia Barra de Ferramentas do Internet Explorer - Bloquear=1 | Liberar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoBandCustomize /t REG_DWORD /d 0x00000000 /f

rem Desativar Assistencia Remota - Bloquear=1 | Liberar=0
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fAllowToGetHelp /t REG_DWORD /d 0x00000000 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x00000000 /f

rem Desativar rastreamento automatico de impressora e compartilhamento na rede - Bloquear=1 | Liberar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoActiveDesktopChanges /t REG_DWORD /d 0x00000000 /f

rem Desativa Protecao de Tela - Ativa o Funcionamento=1 | Desativa=0
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel"
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop"
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /t REG_DWORD /d 0x00000000 /f

rem Desativa Ferramentas Opcoes do Windows Explorer - Forcar=1 | Liberar=0
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoFolderOptions /t REG_DWORD /d 0x00000000 /f

rem Oculta o Icone do Ambiente de Redes do Desktop - Mostra=0 | Oculta=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoNetHood /t REG_DWORD /d 0x00000000 /f

rem Desativa o Logon com Senha em Cache - Desativar=0 | Padro=10
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v cachedlogonscount /t REG_SZ /d 0 /f

rem com Senha em Cache - Desativar=0 | Padro=10
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v cachedlogonscount /t REG_SZ /d 0 /f

rem Configura mensagem no Logon
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Welcome /t REG_SZ /d "Bem vindo a Minha Empresa" /f

rem Oculta os computadores identificados no Ambiente de Rede - Oculta=1 | Mostra=0
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /v Hidden /t REG_DWORD /d 0x00000000 /f

rem Oculta Opcao Mapear Unidade de Rede e Desconectar Unidade de Rede - Desativado=0 | Ativado=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoNetConnectDisconnect /t REG_DWORD /d 0x00000000 /f

rem Oculta Ajuda do Windows no Menu Iniciar - Desativado=0 | Ativado=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoSMHelp /t REG_DWORD /d 0x00000001 /f

rem Oculta Localizar no Menu Iniciar - Desativado=0 | Ativado=1
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoFind /t REG_DWORD /d 0x00000000 /f

rem Desativar Salvar como Papel de Parede - Desativado=1 | Ativado=3
reg add "HKEY_CLASSES_ROOT\SystemFileAssociations\.jpeg" /v ImageOptionFlags /t REG_DWORD /d 0x00000001 /f
reg add "HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg" /v ImageOptionFlags /t REG_DWORD /d 0x00000001 /f
reg add "HKEY_CLASSES_ROOT\SystemFileAssociations\.gif" /v ImageOptionFlags /t REG_DWORD /d 0x00000001 /f
reg add "HKEY_CLASSES_ROOT\SystemFileAssociations\.png" /v ImageOptionFlags /t REG_DWORD /d 0x00000001 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop" /v NoChangingWallpaper /t REG_DWORD /d 0x00000001 /f

rem Desativa Tumnails
C:\WINDOWS\system32\REGSVR32 shimgvw.dll /s

rem Bloquear Jogos/aplicativos no Windows
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v DisallowRun /t REG_SZ /d 1 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 1 /t REG_SZ /d winmine.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 2 /t REG_SZ /d sol.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 3 /t REG_SZ /d mshearts.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 4 /t REG_SZ /d spider.exe /f
rem reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 5 /t REG_SZ /d msnmsgr.exe /f
rem reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 6 /t REG_SZ /d skype.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 7 /t REG_SZ /d hrtzzm.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 8 /t REG_SZ /d chkrzm.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 9 /t REG_SZ /d shvlzm.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 10 /t REG_SZ /d bckgzm.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 11 /t REG_SZ /d Rvsezm.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 12 /t REG_SZ /d pinball.exe /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 13 /t REG_SZ /d freecell.exe /f

terça-feira, 2 de julho de 2013

Redimensionar e diminuir tamanho de imagens no Linux

Autor: Breny Ricardo Martins Coelho
Boa tarde.

Abaixo, segue o conteúdo do script que eu criei para diminuir o tamanho das imagens .JPG no meu servidor.

#!/bin/bash
#
#CONSTANTES
convert="/usr/local/imagemagick/bin/convert"
dir_tmp="/home/breny/tmp/"
dir_img="/home/breny/img"
chmod="/bin/chmod"
chown="/bin/chown"
find="/usr/bin/find"
lsjpg='/bin/ls -1 *.jpeg'
imagem="/bin/cat lista"

#EXECUCAO
cd $dir_tmp
$lsjpg > lista

for s in `$imagem`
        do
                echo $s
                #$convert -resize 2304x768 -crop '1280x720+0+0' +profile '*' $s $dir_img/$s
                $convert -antialias +profile '*' -quality 40 $s $dir_img/$s
                #$convert -antialias +profile '*' -resize 1024x768 $s $dir_img/$s
done