quarta-feira, 23 de setembro de 2015

Editor de VBS



VBSedit que reduz drasticamente o tempo gasto escrevendo roteiros VBS. Possui incluem coloração de sintaxe, debugger embutido, auto-capitalizar, características auto-conclusão (lista de membros do objeto, info parâmetros de exibição, palavras completas), ajuda dinâmica (Se você pressionar F1, o apoio é prestado para a palavra sob o cursor) , trechos de código, toneladas de scripts de amostras, navegador objeto, WMI classes de navegador, e WMI gerador de código.




Fonte: Site

Script de adicionar Usuário local como administrador


Esse script adiciona um usuário especificado ao grupo de administradores local. Isso pode ser executado como um script de inicialização via GPO.


SCRIPT
---------------------------------------------------------------------------------------------------------------


Set objNet = CreateObject("WScript.Network" ) 

' Set the user you want to make local administrator here 
strUser = "<nome do usuário>"

strNetBIOSDomain = objNet.UserDomain 
strComputer = objNet.ComputerName 

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group" ) 
Set objUser = GetObject("WinNT://" & strNetBIOSDomain & "/" & strUser & ",user" ) 

' ignore error if user is already a member of the group
On Error Resume Next 
objGroup.Add(objUser.ADsPath) 
On Error Goto 0 

Script para Padronizar a assinatura do outlook em VBS


Padronizar a assinatura do outlook em sua empresa.
Mas para isso as informações do Usuário no AD, devem estar preenchidas.

Modelo:
————————————————————————————————————

Nome do Usuário
Departamento de TI
Nome da EmpresaEndereço da empresa, XXXX – 3° andar
04000-100 – São Paulo – Brazil
Tel. + 55 11 2222.3333
Fax. + 55 11 4444.5555
Email user@dominio.com.br
Site http://www.empresa.com.br

AQUI APARECE O LOGO DA EMPRESA

Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não pode usar, copiar ou divulgar as informações nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor, avise imediatamente o remetente, respondendo o e-mail, e em seguida apague-o.Agradecemos sua cooperação.
This message may contain confidential and/or privileged information. If you are not the address or authorized to receive this for the address, you must not use, copy, disclose or take any action base on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thankyou for your cooperation

—————————————————————————————————————————————-
‘ O Script:
On Error Resume Next
Set objSysInfo = CreateObject(“ADSystemInfo”)
strUser = objSysInfo.UserName
Set objUser = GetObject(“LDAP://” & strUser)
With objUser
strName = .FullName
strTitle = .Description
End With
strCompany = objUser.Company
strAddress = objUser.streetAddress
strpostalCode = objUser.postalCode
strl = objUser.l
strco = objUser.co
strPhone = objUser.TelephoneNumber
strFax = objUser.facsimileTelephoneNumber
strMail = objuser.mail
strWeb = objuser.wWWHomePage
Set objword = CreateObject(“Word.Application”)
With objword
Set objDoc = .Documents.Add()
Set objSelection = .Selection
Set objEmailOptions = .EmailOptions
End With
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
With objSelection
.ParagraphFormat.Alignment = wdAlignParagraphRight
.TypeParagraph
With .Font
.Name = “Verdana”
.Size = 10
.Bold = false
End With
.TypeText strName & Chr(11)
With .Font
.Name = “Verdana”
.Size = 8
.Bold = False
.Italic = False
End With
.TypeText strTitle & Chr(11)
.TypeText Chr(11)
objSelection.Font.Size = “10”
objSelection.Font.Name = “verdana”
objSelection.Font.Bold = True
objSelection.TypeText strCompany
objSelection.Font.Bold = True
.TypeText Chr(11)
With .Font
.Name = “Verdana”
.Size = 8
.Bold = false
End With
.Font.Italic = False
.TypeText strAddress & Chr(11) & strpostalCode & ” – ” & strl & ” – ” & strco & Chr(11) & “Tel. + ” & strPhone & Chr(11) & “Fax. + ” & strFax & Chr(11) & “Email ” & strMail & Chr(11) & “Site ” & strWeb & Chr(11)
.TypeText Chr(11)
.InlineShapes.AddPicture “\\Server\LogoDaEmpresa.jpg“, True, True
.TypeText Chr(11)
.TypeText Chr(11)
objSelection.Font.Size = “8”
objSelection.Font.italic = true
objSelection.Font.Color = 8421504
objSelection.Font.Bold = False
objSelection.TypeText “Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não pode usar, copiar ou divulgar as informações nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor, avise imediatamente o remetente, respondendo o e-mail, e em seguida apague-o. Agradecemos sua cooperação.”
.TypeText Chr(11)
.TypeText Chr(11)
objSelection.Font.Size = “8”
objSelection.Font.italic = true
objSelection.Font.Color = 8421504
objSelection.Font.Bold = False
objSelection.TypeText “This message may contain confidential and/or privileged information. If you are not the address or authorized to receive this for the address, you must not use, copy, disclose or take any action base on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation”
End With
Set objSelection = objDoc.Range()
objSignatureEntries.Add “AD Signature”, objSelection
objSignatureObject.NewMessageSignature = “AD Signature”
objSignatureObject.ReplyMessageSignature = “AD Signature”
objDoc.Saved = True

objword.Quit

Script de Vbs para mapeamento

Script para mapeamento Unidade de Rede


set net = createobject("wscript.network")
Set FSODrive= CreateObject("Scripting.FileSystemObject")
If not FSODrive.DriveExists("H:") Then
Set NW = CreateObject("WScript.Network")
NW.MapNetworkDrive "H:", "\\fileserver\novadapasta", False
End If
wscript.quit



Script para mapeamento de impressora com configuração deixar padrão

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\computer\print"
WshNetwork.SetDefaultPrinter "\\computer\print"