This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
setlocal EnableDelayedExpansion | |
md out | |
for /f %%G in ('dir /b "*.pdf"') do ( | |
call:_pwgen passwd | |
pdftk %%G output out/%%G user_pw !passwd! | |
echo '%%G', '!passwd!' >> out/passwords.csv | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set timeout 5 | |
log_user 1 | |
# Include your hosts in the hostlist | |
set hostlist "rt01 rt02 sw01 sw02" | |
foreach host $hostlist { | |
set prompt [append $host "#"] | |
spawn telnet $host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires PowerShell 2.0 and Server 2008-R2 or later. | |
import-module ActiveDirectory | |
get-module ActiveDirectory | | |
select-object -expandproperty ExportedCmdlets | | |
format-list value | |
New-PSDrive -PSProvider ActiveDirectory -Server 10.4.4.1 -GlobalCatalog -Root "" -Credential "domain\tim" -Name OtherAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set DOMAIN=DC=Contoso,DC=COM | |
set FLAGS=-pwd "P@$$w0rd" -mustchpwd no -disabled yes | |
for /f "delims=" %%G IN (units.txt) do ( | |
dsadd ou "OU=%%G,%DOMAIN%" | |
dsadd ou "OU=Users,OU=%%G,%DOMAIN%" | |
dsadd ou "OU=Computers,OU=%%G,%DOMAIN%" | |
dsadd group "CN=DL_%%G_WorkstationAdmin,OU=Users,OU=%%G,%DOMAIN%" -scope l | |
dsadd group "CN=GG_%%G_WorkstationAdmin,OU=Users,OU=%%G,%DOMAIN%" -scope g -memberof "CN=DL_%%G_WorkstationAdmin,OU=Users,OU=%%G,%DOMAIN%" | |
dsadd user "CN=%%G.Template,OU=Users,OU=%%G,%DOMAIN%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(tool-bar-mode -1) | |
(require 'color-theme) | |
(color-theme-initialize) | |
(color-theme-clarity) | |
;(transient-mark-mode 1) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DHCPserver="172.16.32.2" | |
$DHCPscope="10.0.0.0" | |
$output="C:\netsh-out.cmd" | |
$csv=Import-CSV "MAC_LIST.csv" | |
# csv file MUST have the following header columns | |
# MAC,IP,NAME | |
# 12345678abcd,10.0.0.20,SITEWKCDR01 | |
$csv | %{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Log on to the first domain controller that you deployed. | |
2. At a command prompt, type the following command, and then press ENTER: | |
w32tm /stripchart /computer:<target> /samples:<number> /dataonly | |
3. Open User Datagram Protocol (UDP) port 123 for outgoing traffic, if needed. | |
4. Open UDP port 123 for incoming NTP traffic. | |
You can use a different port, if you prefer. | |
5. Type the following command to configure the PDC emulator, and then press ENTER: | |
w32tm /config /manualpeerlist:<peers> /syncfromflags:manual /reliable:yes /update | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$smtp = new-object Net.Mail.SmtpClient("mail.example.com") | |
if( $Env:SmtpUseCredentials -eq "true" ) { | |
$credentials = new-object Net.NetworkCredential("username","password") | |
$smtp.Credentials = $credentials | |
} | |
$objMailMessage = New-Object System.Net.Mail.MailMessage | |
$objMailMessage.From = "script@mycompany.com" | |
$objMailMessage.To.Add("you@yourcompany.com") | |
$objMailMessage.Subject = "eMail subject Notification" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Copyright (C) 2009 Allen Sanabria | |
#This program is free software; you can redistribute it and/or modify it under | |
#the terms of the GNU General Public License as published by the Free Software Foundation; | |
#either version 2 of the License, or (at your option) any later version. | |
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | |
#without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
#See the GNU General Public License for more details. You should have received a copy of i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SETLOCAL | |
SET _fileserver=\\file-server\user | |
SET _target=\\file-server\user\%USERNAME% | |
SET _source=%USERPROFILE% | |
SET _options=/MIR /MT /xA:T /XJ /A:N /R:1 /W:2 | |
GOTO MENU1 :: choose robocopy runtime options | |
:JUMP1 |
OlderNewer