Assinatura automatica no Outlook via GPO utilizando dados do AD
Necessário criar um script VBS rodando via script de logon na configuração de usuário
segue script
------------------------- assinatura.vbs ------------------
' VBScript source code
' Configuracao para buscar os dados no Active Directory
' Pagina do script base: http://social.technet.microsoft.com/Forums/pt-BR/scriptadminpt/thread/a591403a-796a-4a45-872d-febe44265e34
' Nome da Consulta no forum: Script para inserir assinatura
' Referencias para Funções: http://www.pctools.com/guides/scripting/id/25/?act=reference
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strFirstName = objuser.givenName
'StrLastName = objuser.sn
strTitle = objUser.Title
srtDepartament = objUser.department
'strCompany = objUser.Company
'strStreet = objUser.StreetAddress
'strLocation = objUser.l
'strCountry = objUser.co
'strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
'strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strNomeArq = "Assinatura " & strFirstName
' Caminho para buscar o logo da empresa
strLogo = "\\SRVAD\netlogon\Assinatura\Logo.png"
strBarra = "\\SRVAD\netlogon\Assinatura\Barra.png"
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objRange = objDoc.Range()
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
' Formatacao de fonte e paragrafo
objSelection.Font.Name = "Franklin Gothic Book"
objSelection.Paragraphs.LineSpacingRule = wdLineSpaceSingle
objselection.Paragraphs.SpaceAfter = 1
objRange.Font.Name = "Franklin Gothic Book"
objRange.Font.Size = 10
' Inicio da Assinatura
' Define uma tabela de 1x1
objDoc.Tables.Add objRange, 1, 2
Set objTable = objDoc.Tables(1)
'Logotipo Empresa
With objTable.Cell(1, 1)
With .Range.Select
objSelection.InlineShapes.AddPicture(strLogo)
objTable.Columns(1).Width = 120
objTable.Columns(2).Width = 440
End With
End With
'Insere nome do funcionario
With objTable.Cell(1, 2)
With .Range.Select
objSelection.Font.Name = "Franklin Gothic Book"
objSelection.Font.Size = "16"
objSelection.Font.Color = RGB(175,0,15)
objSelection.Font.Bold = False
objSelection.TypeText strName & VbCr
'Insere Cargo, email e telefone
Set objSelection = objWord.Selection
objSelection.Font.Bold = False
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB(69,69,69)
objSelection.TypeText strTitle & VbCr
objSelection.TypeText strEmail & VbCr
objSelection.TypeText strPhone & VbCr
objSelection.Font.Size = "5"
objSelection.TypeText VbCr
'Insere barra no final
objSelection.InlineShapes.AddPicture(strBarra)
End With
End With
'Finalizacao e Definicao do nome da assinatura e coloca a mesma como padrao
Set objSelection = objDoc.Range()
objSignatureEntries.Add strNomeArq, objSelection
objSignatureObject.NewMessageSignature = strNomeArq
objSignatureObject.ReplyMessageSignature = strNomeArq
objDoc.Saved = True
objWord.Quit
quinta-feira, 5 de dezembro de 2019
Definindo Wallpaper conforme resolução
Na empresa onde trabalho se fez necessário dois papeis diferentes conforme o tipo de monitor, 4:3 ou 16:9, para isso foi necessário colocar o script abaixo no em uma GPO de logon para que mude o papel de parede conforme o tipo de tela
-------------------------------------
echo off
setLocal EnableDelayedExpansion
if %computername% == Servidor GOTO server
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1920">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1440">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1366">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1360">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1600">Nul && (GOTO wide)
GOTO normal
:wide
copy /y \\servidor\sysvol\scripts\Wallpapers\wide\* %userprofile%\Pictures\
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True
GOTO fim
:normal
copy /y \\servidor\sysvol\scripts\Wallpapers\normal\* %userprofile%\Pictures\
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True
GOTO fim
:server
del /q c:\temp\wallpaper.bmp
del /q c:\temp\wallpaper.jpg
:fim
-------------------------------
Após o script é necessário definir na GPO que o papel de parede é o %userprofile%\Pictures\wallpaper.jpg
Como funciona
Ele verifica a resolução de tela e conforme a resolução copia um arquivo para o %userprofile%\Pictures\ , e a GPO usa esta imagem como padrão
-------------------------------------
echo off
setLocal EnableDelayedExpansion
if %computername% == Servidor GOTO server
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1920">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1440">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1366">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1360">Nul && (GOTO wide)
wmic path Win32_VideoController get CurrentHorizontalResolution| FIND /I "1600">Nul && (GOTO wide)
GOTO normal
:wide
copy /y \\servidor\sysvol\scripts\Wallpapers\wide\* %userprofile%\Pictures\
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True
GOTO fim
:normal
copy /y \\servidor\sysvol\scripts\Wallpapers\normal\* %userprofile%\Pictures\
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True
GOTO fim
:server
del /q c:\temp\wallpaper.bmp
del /q c:\temp\wallpaper.jpg
:fim
-------------------------------
Após o script é necessário definir na GPO que o papel de parede é o %userprofile%\Pictures\wallpaper.jpg
Como funciona
Ele verifica a resolução de tela e conforme a resolução copia um arquivo para o %userprofile%\Pictures\ , e a GPO usa esta imagem como padrão
quarta-feira, 27 de novembro de 2019
Forçar ações automática GLPI
#Força a ativação da tarefa de envio de email
*/1 * * * * php /var/www/html/glpi/front/cron.php --force mailgate
*/1 * * * * root php /var/www/html/glpi/front/cron.php --force mailgate
*/1 * * * * /usr/bin/php5.6 /var/www/html/glpi/front/cron.php --force mailgate
*/1 * * * * /usr/bin/php7.0 /var/www/html/glpi/front/cron.php --force mailgate
*/1 * * * * /usr/bin/php7.1 /var/www/html/glpi/front/cron.php --force mailgate
*/1 * * * * root php /var/www/html/glpi/front/cron.php --force queuedmail
Em outras palavras:
Ele força a execução da tarefa "mailgate" de 1 em 1 minuto
Perceba que coloquei para diversas versões do php, você precisa saber qual é a sua e adicionar a linha conforme sua versão
Aqui, no meu caso, resolveu.
Espero ter ajudado.
Abraço!
terça-feira, 22 de outubro de 2019
Iframe cortando margens
<html>
<head>
<title></title>
</head>
<body>
<div id="content">
<div style="height:800px;"><iframe frameborder="0" height="120%" scrolling="no" src="/portal/p/1/ecmnavigation?app_ecm_navigation_doc=244" style="position:absolute;
top:-100px; left:-80px;" width="110%"></iframe></div>
</div>
</body>
</html>
<head>
<title></title>
</head>
<body>
<div id="content">
<div style="height:800px;"><iframe frameborder="0" height="120%" scrolling="no" src="/portal/p/1/ecmnavigation?app_ecm_navigation_doc=244" style="position:absolute;
top:-100px; left:-80px;" width="110%"></iframe></div>
</div>
</body>
</html>
sexta-feira, 11 de outubro de 2019
How to disable Amazon Kindle Keyboard screensaver
By default if you leave your Kindle Keyboard idle for 10 minutes without turning a page, it will enter screensaver mode (sleep mode). There are times you just need it to stay on a page without going in to screensaver mode. This post will show you how you can disable the screensaver mode.
ress Home button.
Press Del button. This will bring up the search box.
Type ;debugOn and press Enter.
Type ~disableScreensaver and press Enter.
Type ;debugOff and press Enter.
Once you have disabled the screensaver mode, you can manually switch to screensaver mode by using the power slider.
Re-enable screensaver mode
Press Home button.
Press Del button. This will bring up the search box.
Type ;debugOn and press Enter.
Type ~resumeScreensaver and press Enter.
Type ;debugOff and press Enter.
ress Home button.
Press Del button. This will bring up the search box.
Type ;debugOn and press Enter.
Type ~disableScreensaver and press Enter.
Type ;debugOff and press Enter.
Once you have disabled the screensaver mode, you can manually switch to screensaver mode by using the power slider.
Re-enable screensaver mode
Press Home button.
Press Del button. This will bring up the search box.
Type ;debugOn and press Enter.
Type ~resumeScreensaver and press Enter.
Type ;debugOff and press Enter.
quinta-feira, 15 de agosto de 2019
Ativar opção de conta nunca expira no Office 365
Comando via powershell
Comandos para conectar ao PowerShell
Set-executionpolicy
unrestricted
Set-ExecutionPolicy
RemoteSigned
$LiveCred =
Get-Credential
$Session =
New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/
-Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession
$Session
Connect-Msolservice
-Credential $LiveCred
Configura pra não expirar mais a senha
Set-MSOLUser
-UserPrincipalName usuario@dominio.com -PasswordNeverExpires $true
Consulta o usuário
quarta-feira, 17 de julho de 2019
Dicas Específicos
- Localizar programas que tratam por grupo de usuários
- usuar_grp_usuar.cod_grp_usuar = 'XXX'
Assinar:
Postagens (Atom)