quarta-feira, março 22, 2017

Timeout no arranque de serviços do SQL Server


Em determinadas circunstâncias os serviços do SQL Server podem não arrancar automaticamente quando o Windows inicia. No meu caso passaram a existir problemas, no Windows 10, após uma determinada atualização recente (KB3201845). Mesmo após remover esta atualização e efetuar ao restart ao sistema, o serviço do SQL Server não arrancava automaticamente e como consequência o ERP Primavera não abria. Se o serviço fosse iniciado manualmente, aí sim, arrancava com normalidade. Após analisar os eventos do Windows detetei que existia um tempo limite de arranque que tinha sido atingido (ID do evento: 7009). O serviço tenta arrancar dentro de um determinado tempo estabelecido. Se não conseguir por qualquer motivo, deixa de tentar novamente.
image

Uma das formas de ultrapassar e contornar este problema pode passar por aumentar o tempo limite para um valor superior (o dobro ou o triplo por exemplo). Para esse efeito criei uma nova chave no registo do Windows, conforme imagem em baixo.
image
Como proceder?:
Abra o registo do Windows (tecla Windows+R) e escreva regedit. Navegue até:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Agora, com o botão direito em cima de Control, crie uma nova chave do tipo DWORD. Altere o nome da chave para ServicesPipeTimeout. Modifique a chave de acordo com a imagem acima (“Base” e “Dados do valor”). No campo do valor coloque o valor pretendido, em milissegundos. Reinicie o computador e teste.


Artigos relacionados:

How to disable SSL v2 and SSL v3 on Windows Server via Group Policy

n this article I will show you how to disable the SSL v2 and SSL v3 protocols on the Windows Server so that it no longer offers the depreciated (a.k.a. Broken) SSL v2 and v3 security protocols. It also does not hurt if you apply this policy settings to your Windows client computers in case any of them have IIS with digital certificate enabled.
Note: That if you are running a non Microsoft web server such as Apache then you will need to contact that vendor for specific instructions on how to disabled the protocol.

The first step will be to create a Group Policy that is targeted to the servers that you want to disable SSL. Then open up Computer Configuration > Preferences > Windows Settings > Registry. Then create two new “Registry Items” as per follows:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server
Name: Enabled
Value: Reg_Dword 0
image
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server
Name: Enabled
Value: Reg_Dword 0
image
Restart the server and you should now be done.
Alternatively, if your server is not domain joined then you can save the below registry key information as a .Reg file and just manually apply it to your server.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server] “Enabled”=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server] “Enabled”=dword:00000000
Once you have applied the setting to the server it would be best to reboot to ensure that the setting is properly applied. If you web server is on the internet then you can ensure that is has worked by using the http://ssllabs.com/ web site to perform a test against you site.
As you can see with the examples below, having SSL v2 and v3 enabled can make the world of difference in the of security of your web site.
image
image
Additional references: http://disablessl3.com/

Windows 3.10 to Windows 10

Na execução de um experimento mais do que curioso, Andrew Tait, responsável pelo canal TheRasteri no YouTube, decidiu instalar e atualizar em um mesmo computador todas as principais versões do Windows já lançadas. No vídeo, é possível ver (em velocidade aumentada) a instalação e o uso de cada uma delas enquanto o responsável pela proeza narra (em inglês) todas as dificuldades pelas quais passou durante o processo.
Começando do zero, com um computador formatado, Tait partiu da versão 3.10 do MS DOS – que nem era vendida na época, apenas a partir da versão 5 – e passou por cada uma das edições já lançadas do Windows nos últimos 36 anos de Microsoft. A única versão que ele pulou foi o Windows ME, pois ele não permite que se faça uma atualização para o Windows 2000, o que interromperia a sequência.
Algumas versões do Windows: curioso como o logo do Windows 8 se parece com o da primeira edição

Incrível jornada

O processo demorou três dias para ser concluído até o Windows 10 e, desse período, 12 horas foram gastas apenas para as instalações. Durante essa “aventura”, Tait ainda pode relembrar programas e jogos nostálgicos, como o Pagemaker, o Paintbrush, Doom 2 e Monkey Island. Os games, inclusive, funcionaram normalmente através das atualizações até o Windows 7, surpreendentemente.
Confira no vídeo abaixo essa jornada que condensa 36 anos de Microsoft e três dias de trabalho em menos de 10 minutos:



terça-feira, março 21, 2017

PFsence 2.0.2 Release Now Available!

pfSense 2.0.2 is a maintenance release with some bug and security fixes since 2.0.1 release. You can upgrade from any previous release to 2.0.2.

Heads up for those upgrading

Auto Update URL – For those upgrading from a prior release, first please make sure you’re on the correct auto-update URL. Tens of thousands of installs were from 2.0 pre-release snapshots which had their update URL set to the snapshot server rather than the stable release updates. Others had manually set their architecture incorrectly at some point and had failed upgrades because of it. Just browse to System>Firmware, Updater Settings tab. From the “Default Auto Update URLs” drop down box, pick either the stable i386 or amd64 depending on which version you have installed, and click Save. Then you can use the auto-update and be ensured you’re pulling from the correct location.
PPP-assigned DNS server problem – those with PPP type WANs (PPP, PPPoE) using the DNS servers assigned by their ISP rather than ones defined under System>General Setup, be aware those DNS servers will not be used. There are two work arounds detailed here.

FreeBSD Security Advisories

Base OS updated to 8.1-RELEASE-p13 to address the following FreeBSD Security Advisories:
  • NOTE: FreeBSD-SA-12:03.bind, FreeBSD-SA-12:05.bind, and FreeBSD-SA-12:06.bind do not apply to us, since we do not use nor include bind. FreeBSD-SA-12:08.linux does not apply since we do not use nor include the Linux compatibility layer of FreeBSD. FreeBSD-SA-12:02.crypt doesn’t apply because we don’t use DES in that context.

PPTP

  • Added a warning to PPTP VPN configuration page: PPTP is no longer considered a secure VPN technology because it relies upon MS-CHAPv2 which has been compromised. If you continue to use PPTP be aware that intercepted traffic can be decrypted by a third party, so it should be considered unencrypted. We advise migrating to another VPN type such as OpenVPN or IPsec.
  • Fix reference to PPTP secondary RADIUS server shared secret.
  • PPTP 1.x to 2.x config upgrade fixes.

NTP Changes

  • OpenNTPD was dropped in favor of the ntp.org NTP daemon, used by FreeBSD.
  • Status page added (Status > NTP) to show status of clock sync
  • NTP logging fixed.
  • NOTE: ntpd will bind/listen to all interfaces by default, and it has to in order to receive replies. You can still do selective interface binding to control which IPs will accept traffic, but be aware that the default behavior has changed.

Dashboard & General GUI Fixes

  • Various fixes for typos, wording, and so on.
  • Do not redirect on saving services status widget.
  • Don’t use $pconfig in widgets, it has unintended side effects.
  • Fix display of widgets with configuration controls in IE.
  • Changed some padding/margin in the CSS in order to avoid wrapping the menu.
  • #2165 Change to embed to prevent IE9 from misbehaving when loading the Traffic Graph page

OpenVPN Fixes

  • Safer for 1.2.3 upgrades to assume OpenVPN interface == any, since 1.2.3 didn’t have a way to bind to an interface. Otherwise people accepting connections on OPT interfaces on 1.2.3 will break on upgrade until the proper interface is selected in the GUI
  • Don’t ignore when multiple OpenVPN DNS, NTP, WINS, etc servers were specified in 1.2.3 when upgrading. 1.2.3 separated by ;, 2.x uses separate vars.
  • Fix upgrade code for 1.2.3 with assigned OpenVPN interface.
  • Fix LZO setting for Upgraded OpenVPN (was turning compression on even if old config had it disabled.)
  • Be more intelligent when managing OpenVPN client connections bound to CARP VIPs. If the interface is in BACKUP status, do not start the client. Add a section to rc.carpmaster and rc.carpbackup to trigger this start/stop. If an OpenVPN client is active on both the master and backup system, they will cause conflicting connections to the server. Servers do not care as they only accept, not initiate.

IPsec fixes

  • Only do foreach on IPsec p2′s if it’s actually an array.
  • #2201 Don’t let an empty subnet into racoon.conf, it can cause parse errors.
  • #2201 Reject an interface without a subnet as a network source in the IPsec Phase 2 GUI.
  • Add routes even when IPsec is on WAN, as WAN may not be the default gateway.
  • #1986 Revamped IPsec status display and widget to properly account for mobile clients.
  • Fixed a bug that caused the IPsec status and widget to display slowly when mobile clients were enabled.

User Manager Fixes

  • #2066 Improve adding/removing of users accounts to the underlying OS, especially accounts with a numeric username.
  • Include admin user in bootup account sync
  • Fix permission and certificate display for the admin user
  • Fix ssh key note to refer to DSA not just RSA since both work.
  • “:” chars are invalid in a comment field, filter them out.
  • When renaming a user, make sure to remove the previous user or it gets left in /etc/passwd.
  • #2326 Do not allow empty passwords since this might cause problems for some authentication servers like LDAP.

Captive Portal Fixes

  • Take routing table into account when figuring out which IP address to use for talking to CP clients.
  • Prevent browser auto-fill username and password on voucher config, as it can interfere with the settings being properly saved if sync isn’t fully configured, which this can make happen accidentally.
  • Correct the Called-Station-Id attribute setting to be the same on STOP/START packets
  • Correct the Called-Station-Id attribute setting to be consistent on the data sent
  • #2082 Correct the log to display the correct information about an existing session
  • #2052 Remove duplicate rule
  • Fix which roll to write when writing the active voucher db
  • Always load ipfw when enabling CP to ensure the pfil hooks are setup right
  • #2378 Fix selection of CP interfaces when using more than 10 opt interfaces.
  • Strengthen voucher randomization.

NAT/Firewall Rules/Alias Fixes

  • #2327 Respect the value of the per-rule “disable reply-to” checkbox.
  • #1882 Fix an invalid pf rule generated from a port forward with dest=any on an interface with ip=none
  • #2163 1:1 Reflection fixes for static route subnets and multiple subnets on the same interface.
  • Better validation on URL table alias input from downloaded files.
  • #2293 Don’t put an extra space after “pass” when assuming it as the default action or later tests will fail to match this as a pass rule.
  • Update help text for Host aliases to indicate FQDNs are allowed.
  • #2210 Go back to scrub rather than “scrub in”, the latter breaks MSS clamping for egress traffic the way we use it.
  • Fix preservation of the selection of interfaces on input errors for floating rules.
  • Fix URL table update frequency box.
  • Fix input validation for port forwards, Local Port must be specified.
  • Added a setting to increase the maximum number of pf tables, and increased the default to 3000.
  • Properly determine active GUI and redirect ports for anti-lockout rule, for display and in the actual rule.
  • Handle loading pf limits (timers, states, table/entry limits, etc) in a separate file to avoid a chicken-and-egg scenario where the limits would never be increased properly.

Interface/Bridging Fixes

  • Correct checking if a gif is part of bridge so that it actually works correctly adding a gif after having created it on bootup
  • Use the latest functions from pfSense module for getting interface list
  • Use the latest functions from pfSense module for creating bridges
  • Implement is_jumbo_capable in a more performant way. This should help with large number of interfaces
  • Since the CARP interface name changed to “vipN” from “carpN”, devd needs to follow that change as well.
  • #2242 Show lagg protocol and member interfaces on Status > Interfaces.
  • #2212 Correctly stop dhclient process when an interface is changed away from DHCP.
  • Fixed 3G SIM PIN usage for Huawei devices
  • Properly obey MTU set on Interface page for PPP type WANs.

Other Misc. Fixes

  • #2057 Add a checkbox that disables automatically generating negate rules for directly connected networks and VPNs.
  • Mark “Destination server” as a required field for DHCP Relay
  • Clarify the potential pitfalls when setting the Frequency Probe and Down parameters.
  • Add a PHP Shell shortcut to disable referer check (playback disablereferercheck)
  • #2040 Make Wireless Status tables sortable
  • #2068 Fix multiple keys in a file for RFC2136 dyndns updates.
  • Check to see if the pid file exists before trying to kill a process
  • #2144 Be smarter about how to split a Namecheap hostname into host/domain.
  • Add a small script to disable APM on ATA drives if they claim to support it. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles. The APM bit set will persist until the drive is power cycled, so it’s necessary to run on each boot to be sure.
  • #2158 Change SNMP binding option to work on any eligible interface/VIP. If the old bindlan option is there, assume the lan interface for binding.
  • Fix reference to PPTP secondary RADIUS server shared secret.
  • #2147 Add button to download a .p12 of a cert+key.
  • #2233 Carry over the key length on input errors when creating a certificate signing request.
  • #2207 Use PHP’s built-in RFC 2822 date format, rather than trying to make our own.
  • Allow specifying the branch name after the repository URL for gitsync command-line arguments and remove an unnecessary use of the backtick operator.
  • Correct send_multiple_events to conform with new check_reload_status behaviour
  • Do not wipe logs on reboot on full install
  • Set FCGI_CHILDREN to 0 since it does not make sense for php to manage itself when lighttpd is doing so. This makes it possible to recover from 550-Internal… error.
  • Support for xmlrpcauthuser and xmlrpcauthpass in $g.
  • Fix Layer 7 pattern upload, button text check was incorrect.
  • Correct building of traffic shaping queue to not depend on parent mask
  • #2239 Add alias support to static routes
  • Use !empty instead of isset to prevent accidental deletion of the last used repository URL when firmware update gitsync settings have been saved without a repository URL.
  • Better error handling for crypt_data and also better password argument handling
  • Stop service needs to wait for the process to be stopped before trying to restart it.
  • Use a better default update url
  • Fix missing description in rowhelper for packages.
  • #2402#1564 Move the stop_packages code to a function, and call the function from the shell script, and call the function directly for a reboot.
  • #1917 Fix DHCP domain search list
  • Update Time Zone zoneinfo database using latest zones from FreeBSD
  • Handle HTTPOnly and Secure flags on cookies
  • Fixed notifications for firmware upgrade progress
  • Removed an invalid declaration that considered 99.0.0.0/8 a private address.
  • Fixed redirect request for IE8/9
  • #1049 Fix crashes on NanoBSD during package removal/reinstall. Could result in the GUI being inaccessible after a firmware update.
  • Fix some issues with upgrading NanoBSD+VGA and NanoBSD+VGA Image Generation
  • Fix issues upgrading from systems with the old “Uniprocessor” kernel which no longer exists.
  • Fix a few potential XSS/CSRF vectors. Thanks to Ben Williams for his assistance in this area.
  • Fixed issue with login page not showing the correct selected theme in certain configurations.
  • Fix limiters+multi-wan

Binary/Supporting Program Updates

  • Some cleanup to reduce overall image size
  • Fixes to ipfw-classifyd file reading and handling
  • Updated miniupnpd
  • ISC DHCPD 4.2.4-P1
  • mdp5 upgraded to 5.6
  • pftop updated
  • lighttpd updated to 1.4.32, for CVE-2011-4362 and CVE-2012-5533.

Upgrade Information

As always, information on upgrading can be found in the Upgrade Guide.

Download

Downloads for new installs can be found on the mirrors here.
Upgrades can be found here.
Note: some mirrors are still syncing, it will be several hours from the time of this post until all are synced.

Linux : comandos grep, fgrep e egrep





Sintaxe: 

grep [opções] padrão arquivos
fgrep [opções] padrão arquivos
egrep [opções] padrão arquivos 

Opções:


  • -F :: O mesmo que fgrep. Interpreta padrão como uma expressão regular sem metacaracteres.
  • -E :: Similar a egrep. Interpreta padrão como uma expressão regular estendida.
  • -r :: Faz procura recursiva.
  • -e expr :: Procura pela expressão regular expr.
  • -n :: Exibe o número de linhas que contém o padrão.
  • -c :: Exibe apenas o número de linhas que contém o padrão de busca.
  • -f arquivo :: Lê o padrão a partir do arquivo especificado.
  • -i :: Não diferencia maiúsculas de minúsculas na procura.
  • -l :: Exibe os nomes de arquivos que contém o padrão.
  • -v :: Exibe as linhas que não contém o padrão.
  • -w :: Procura apenas palavras inteiras.

Observação: recomenda-se que o padrão esteja entre apóstrofos ('), pois alguns caracteres tem significado especial para o shell e podem ser interpretados erroneamente. 

Exemplos: 

Procura a palavra "tee" dentro do arquivo /etc/info-dir e exibe o número da linha onde ela ocorre: 

grep -n tee /etc/info-dir
70:* tee: (sh-utils) tee invocation. Redirect to multiple files
Procura todos os arquivos abaixo de /etc que possuem a palavra mouse: 

grep -r mouse /etc/* 

SHELL SCRIPT : Reiniciar o Apache com Log


Para os que tem necessidade de reiniciar o apache todos os dias eis um script que é só colocar no crontab e resolvemos o problema:



  • Criar o Script restartapache.sh



#!/bin/bash

hoje=$(date +"%y_%m_%d")


/etc/init.d/apache2 restart


hora=$(date +"%H:%M:%S %Z")


echo -ne "[$hora]  o apache foi reiniciado. \r\n"  >> log_ResetApache.$hoje.txt




  • Transforme o script em executável:


#chmod +x restartapache.sh


  • Edição  Crontab

# crontab -e

Feito. Precisamos agora adicionar o período (tempo) que o cron deve chamar o nosso script de backup.

A sintaxe do crontab é bastante fácil de se trabalhar. A sintaxe para chamar nosso script deve ficar assim:

mm HH DD MM DS /usr/local/bin/restartapache.sh

Onde:

mm: minutos
HH: horas
DD: dia
MM: mês
DS: dia da semana
/usr/local/bin/backup.sh: tarefa a ser realizada

Neste exemplo, faríamos com que o script seja executado todos os dias as 22hrs. Veja:

00 22 * * * /usr/local/bin/restartapache.sh

Pronto. Salve o arquivo, e reinicie o cron para que a rotina funcione:

# /etc/init.d/cron restart

Como aceder a sites em Flash no Chrome 57


Com a chegada do Chrome 57 temos um Chrome mais eficiente que nunca, mas simultaneamente também é dado mais um passo no sentido de dizer adeus ao Flash. Se ainda tiverem necessidade de aceder a sites em Flash, há no entanto uma solução.

Há inúmeras situações em que o Flash foi mal utilizado e faz todo o sentido bloqueá-lo, mas do lado oposto também bastantes excepções em que a utilização do Flash é bem feita e ainda não existem alternativas em HTML5 que o substituam.

Por exemplo, a nível pessoal, sou um grande fã e utilizador do Sumopaint, um verdadeiro "Photoshop" na web... feito em Flash. E com a mais recente versão do Chrome, o resultado que obtinha era o de que o browser não suportava Flash, dizendo-me que tinha que o instalar caso desejasse utilizar o site. E imagino que o mesmo terá acontecido a muitas outras pessoas, com outros sites em Flash (por exemplo, jogos) que neste Chrome mais recente ficam "desligados".

Actualização: afinal isto apenas acontecia a quem tinha activado a anterior opção "Click to play", para os restantes a opção pré-definida é o site em Flash perguntar se o utilizador o quer executar.


Felizmente é um problema que por agora é bastante simples de resolver. Basta dar um salto aos Settings->(Show Advanced Settings)->Content Settings->Manage Exceptions (na secção Flash).

Nesta secção poderão adicionar todos os sites que utilizam com frequência e que dependem do Flash para funcionar, criando excepções para o bloqueio feito pelo Chrome.

É certo que isto não evita que eventualmente lá chegue o dia em que o Flash desapareça mesmo do Chrome e deixem de haver "excepções"; mas pelo por agora, fica o problema resolvido.


Fonte http://abertoatedemadrugada.com/2017/03/como-aceder-sites-em-flash-no-chrome-57.html

segunda-feira, março 20, 2017

[PHP CACHE] OPcache - Instalando e usar

Todo mundo sabe que cache é a primeira coisa a se fazer para melhorar a performance de uma aplicação. O que muitos devs não sabem é que o PHP já vem com o OPcache desde a versão 5.5 ou superior, mas calma, se você não usa esta versão do PHP não se preocupe, não vai afetar seus arquivos PHP, a configuração é feita dentro do php.ini.

Como funciona?

Sempre que requisitamos um arquivo PHP ele faz todo o processo que já conhecemos, carrega os arquivos, debug, executa o código, enfim... isso não é o importante. Ao final ele gera um bytecode com tudo pronto, imagine se ao invés de utilizar o arquivo PHP em si ele apenas pegasse esse bytecode e pronto, muito mais rápido.
O OPcache faz exatamente isso, e é muito simples de habilitar.

Fazendo funcionar

Primeiro descubra aonde o seu arquivo php.ini está, isso é muito simples, apenas rode um phpinfo() criando um arquivo php com o seguinte código:

phpinfo();
E no navegador (ou no terminal) encontre a linha Configuration File (php.ini) Path, pronto, você achou o php.ini.
Abra o php.ini e adicione a seguinte linha:
extension=php_opcache.dll
Ao rodar você pdoe ter uma mensagem de erro, se este for o seu caso tente o código abaixo ao invés do anterior.
zend_extension=php_opcache.dll
Ela pode ficar junto com as outras instruções de carregamento de extensões, você sód eve tomar o cuidado de adicionar antes do carregamento da extensão do XDebug (se tiver instalado, claro), se não vai dar erro.
Pronto, instalado.

Configurando

O meu php.ini já trouxe uma sessão com exemplos de configuração,s e o seu também tiver, estude esta parte do arquivo com calma e entenda o que cada parâmetro faz.
Atualmente estou usando esta configuração:
opcache.validate_timestamp = 1
opcache.revalidate_freq = 0
opcache.memory_consumption = 64
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 4000
opcache.fast_shutdown = 1
Você pode colocar depois da linha de carregamento da extensão.
O importante é entender a primeira linha, o ideal para ambientes de produção é que seja passado um 0, assim o PHP não vai checar se houve mudança no arquivo, porém para ambientes de desenvolvimento isso pode dar dor de cabeça, já que você vai ter que limpar o cache "na mão".
Para limpar o cache manualmente apenas rode o comando opcache_reset(), claro que você vai precisar de um arquivo parecido com este:

opcache_reset();
Agora é só usar a criatividade pra usá-lo, pode ser em linha de comando, no navegador ou até colocar em um executável nas variáveis de ambiente:
php opcache_reset.php
No Windows este arquivo se chamaria opcachereset.bat e no Linux e no Mac apenas opcachereset, sem extensão.

Checando

Logo após reiniciar o server verifique no phpinfo() se o bloco Zend OPcache existe e se o status Opcode Caching é Opcode Caching e o Optimization é Enabled, se estiver assim, você fez tudo certo.

Conclusão

O OPcache é uma solução incrível que o PHP 5.5 trouxe para melhorar a performance da sua aplicação, é só ativar pra usar, não precisa configurar nada no seu projeto (o que aumenta a compatibilidade da aplicação). O único ponto é que você precisa encontrar uma hospedagem que já tenha suporte ao PHP 5.5 e o OPcache ativado, claro que se você tem um Cloud (ou afins) não vai ter problema.

Script de mapeamento de unidades do perfil em um Domínio


1 Antes iremos criar um arquivo .bat chamando o arquivo .vbs Iremos também criar um arquivo de exclusão dos mapeamentos antigos.
Arquivo .vbs de exclusão dos mapeamentos antigos: exclui.vbs

Set oFs = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("WScript.Network")
For Each drv in oFs.Drives
   if drv.DriveLetter <> "A" and drv.DriveLetter <> "B" and drv.DriveLetter <> "C" and drv.DriveLetter <> "D" and drv.DriveLetter <> "E" then
      letra = cstr(drv.DriveLetter) & ":"
      objNetwork.RemoveNetworkDrive letra , true ,true
   end if
Next
2 Arquivo .vbs de criação dos mapeamentos dos diretórios: map.vbs
set net = createobject("wscript.network")
Set FSODrive= CreateObject("Scripting.FileSystemObject")
    Set NW = CreateObject("WScript.Network")
If not FSODrive.DriveExists("H:") Then
NW.MapNetworkDrive "DIRETÓRIO:", "\\CAMINHO DO DIRETÓRIO", True
wscript.quit

3 Agora iremos correr este .bat que ira efetuar a exclusão e mapeamento dos arquivos, este arquivo colocamos no AD de cada perfil do Domínio em Script Logon: map.bat
echo off
echo.
echo .....
echo.
echo O Windows esta  Mapeando as Unidades...
echo Aguarde por favor!
echo.
echo Esta tela fechar  automaticamente em poucos segundos.
echo.
echo wscript \\CAMINHO DOMINIO\NETLOGON\scripts\exclui.vbs
wscript \\CAMINHO DOMINIO\NETLOGON\scripts\map.vbs




LinkWithin

Related Posts Widget for Blogs by LinkWithin