Deploying Apps w/Spiceworks

1.       Download PDQ Deploy
This is a free program (standard version) and can be found at...http://www.adminarsenal.com/pdq-deploy/main/

2.       connect PDQ Deploy to Spiceworks

3.       Obtain software to deploy
PDQ Deploy makes it very easy to deploy MSI files siliently with no reboot after. I used the Adobe tool to create my Adobe Reader X install just the way i wanted to before i deployed it. http://www.adobe.com/support/downloads/detail.jsp?ftpID=4950
You can also use EXE files just keep in mind you will probably need to know the command line switches for them, for instance my silent office 2010 install i created a custom MSP using Microsoft tools and use that in PDQ Deploy.
setup.exe /adminfile Updates/Office2010StdSP1Unattended.MSP         

4.       Create Spiceworks software report.
Unfortunately Spiceworks doesnt allow you to group machines by software ....yet ;) So i created a simple report in Spiceworks to show me all of my machines that had Adobe Reader version 6-9 installed and exported it to a CSV file.       

5.       Import CSV into PDQ Deploy
One you have the CSV file you can import that list into PDQ Deploy very easily.

6.       DEPLOY!!!
Select the machines out of the list you imported (all we be selected by default) to deploy your software to and deploy!               

Appdeploy.com - CAN HELP YOU FIND A SIMPLE INSTALL SCRIPT SILENT ETC…

Copy Pictures/ Video/ Audio while maintaining file structure

REM  Copy Pictures/ Video/ Audio while maintaining file structure

@Echo off


Echo ============================= >> C:\copy_log.txt
Echo =                           = >> C:\copy_log.txt
Echo ============================= >> C:\copy_log.txt


cd C:\

ROBOCOPY C:\SOURCE C:\DESTINATION *.aif *.iff *.m3u *.m4a *.mid *.mp3 *.ra *.wav *.wma *.3g2 *.3gp *.asf *.asx *.avi *.flv *.mov *.mp4 *.mpg *.rm *.swf *.vob *.wmv *.tiff *.tif *.png *.jpg *.jpeg *.gif *.exif *.bmp /E >> C:\copy_log.txt


Echo ============================= >> C:\copy_log.txt
Echo =                           = >> C:\copy_log.txt
Echo ============================= >> C:\copy_log.txt

Backup VMware Server Guests

@ECHO OFF


::Backup of Virtual Hard Drives and Configuration Files
::Only tested on Server 2003 running VMware Server version 2.0.1 build-156745
::http://www.virtuatopia.com/index.php/Controlling_VMware_Virtual_Machines_from_the_Command_Line_with_vmrun

::For a list of running VMs and on the server run this from the VM Host
::"C:\Program Files\VMware\VMware Server\vmrun.exe" -T server -h https://localhost:8333/sdk -u ADMIN -p PASS list



:WARNING

echo By running the backup the guest server(s) will be shutdown

echo Are you sure you wish to continue?

timeout /T 30

cls



:: Header of Logfile

echo. >> "C:\IT\VM-Backup.log"

echo %date% >> "C:\IT\VM-Backup.log"



::Variables:

set bakloc="\\vmserver2\e$\BACKUP-VM1"

SET /A SRV=1

set vmrun="C:\Program Files\VMware\VMware Server\vmrun.exe"

set username=ADMIN

set password=PASS

set datastore=E:\Virtual Machines



:: Verify mapped Drive "V:\"

if not exist v: net use v: %bakloc%

if not exist v: echo Mapped Drive V:\ or link to %bakloc% not present >> "C:\IT\VM-Backup.log"

if not exist v: goto END



set overall=%time%

goto %SRV%



:1

set start=%time%

set SERVER=TEST1

SET VMGUEST="[VMSERVER1] TEST1/Windows Server 2003 Enterprise Edition.vmx"

Title Backup of %SERVER% in Progress

::if exist "V:\%server%" del "V:\%server%\*.*" /q

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% stop %VMGUEST% soft

timeout /T 120

xcopy "%datastore%\%SERVER%\*.vmdk" "V:\%SERVER%\" /C /R /Y

xcopy "%datastore%\%SERVER%\*.vmx" "V:\%SERVER%\" /C /R /Y

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% start %VMGUEST%

set finish=%time%

goto CON



:2

set start=%time%

set SERVER=TEST2

SET VMGUEST="[VMSERVER1] TEST2/Windows XP Professional.vmx"

Title Backup of %SERVER% in Progress

::if exist "V:\%server%" del "V:\%server%\*.*" /q

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% stop %VMGUEST% soft

timeout /T 120

xcopy "%datastore%\%SERVER%\*.vmdk" "V:\%SERVER%\" /C /R /Y

xcopy "%datastore%\%SERVER%\*.vmx" "V:\%SERVER%\" /C /R /Y

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% start %VMGUEST%

set finish=%time%

goto CON



:3

set start=%time%

set SERVER=TEST3

SET VMGUEST="[VMSERVER1] TEST3/Windows Server 2003 Enterprise Edition.vmx"

Title Backup of %SERVER% in Progress

::if exist "V:\%server%" del "V:\%server%\*.*" /q

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% stop %VMGUEST% soft

timeout /T 120

xcopy "%datastore%\%SERVER%\*.vmdk" "V:\%SERVER%\" /C /R /Y

xcopy "%datastore%\%SERVER%\*.vmx" "V:\%SERVER%\" /C /R /Y

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% start %VMGUEST%

set finish=%time%

goto CON



:4

set start=%time%

set SERVER=TEST4

SET VMGUEST="[VMSERVER1] TEST4/Windows Server 2003.vmx"

Title Backup of %SERVER% in Progress

::if exist "V:\%server%" del "V:\%server%\*.*" /q

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% stop %VMGUEST% soft

timeout /T 120

xcopy "%datastore%\%SERVER%\*.vmdk" "V:\%SERVER%\" /C /R /Y

xcopy "%datastore%\%SERVER%\*.vmx" "V:\%SERVER%\" /C /R /Y

%vmrun% -T server -h https://localhost:8333/sdk -u %username% -p %password% start %VMGUEST%

set finish=%time%

goto CON



:: Add new servers to the list above

:: Keep This Set Last but update the number!



:5

echo.

echo %start%

set start=%overall%

set finish=%time%

set SRV=0

set SERVER=done

goto CON



:CON

:: time conversion

set shh=%start:~0,2%

set smm=%start:~3,2%

set sss=%start:~6,2%

set sms=%start:~9,2%

if %shh% LSS 10 set shh=%shh:~1,1%

if %smm% LSS 10 set smm=%smm:~1,1%

if %sss% LSS 10 set sss=%sss:~1,1%

if %sms% LSS 10 set sms=%sms:~1,1%

SET /a Start100S=%shh%*360000+%smm%*6000+%sss%*100+%sms%

set fhh=%finish:~0,2%

set fmm=%finish:~3,2%

set fss=%finish:~6,2%

set fms=%finish:~9,2%

if %fhh% LSS 10 set fhh=%fhh:~1,1%

if %fmm% LSS 10 set fmm=%fmm:~1,1%

if %fss% LSS 10 set fss=%fss:~1,1%

if %fms% LSS 10 set fms=%fms:~1,1%

SET /a Finish100S=%fhh%*360000+%fmm%*6000+%fss%*100+%fms%



:: START midnight rollover. If so, add 1 day=8640000 1/100ths secs

IF %Finish100S% LSS %Start100S% SET /a Finish100S+=8640000

SET /a TookTime=%Finish100S%-%Start100S%



if %TookTime% LEQ 99 goto MILLI

if %TookTime:~0,-2% GEQ 3600 goto HRS

if %TookTime:~0,-2% GEQ 60 goto MINS

if %TookTime:~0,-2% GEQ 1 goto SECS

goto ERR0



:HRS

SET /A HRS=%TookTime:~0,-2%/3600

SET /A MINS=(%TookTime:~0,-2%-%HRS%*3600)/60

SET /A SECS=%TookTime:~0,-2%-(%HRS%*3600+%MINS%*60)

set ELAPSED=%HRS% Hours %MINS% Minutes %SECS%.%TookTime:~-2% Seconds

IF %SERVER% NEQ done echo %SERVER% elapsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SERVER% EQU done echo Total elaspsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SRV% EQU 0 goto END

SET /A SRV=%SRV%+1

goto %SRV%



:MINS

SET /A MINS=%TookTime:~0,-2%/60

SET /A SECS=%TookTime:~0,-2%-%MINS%*60

set ELAPSED=%MINS% Minutes %SECS%.%TookTime:~-2% Seconds

IF %SERVER% NEQ done echo %SERVER% elapsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SERVER% EQU done echo Total elaspsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SRV% EQU 0 goto END

SET /A SRV=%SRV%+1

goto %SRV%



:SECS

set ELAPSED=%TookTime:~0,-2%.%TookTime:~-2% Seconds

IF %SERVER% NEQ done echo %SERVER% elapsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SERVER% EQU done echo Total elaspsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SRV% EQU 0 goto END

SET /A SRV=%SRV%+1

goto %SRV%



:MILLI

set ELAPSED=.%TookTime:~-2% Seconds

IF %SERVER% NEQ done echo %SERVER% elapsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SERVER% EQU done echo Total elaspsed time: %ELAPSED% >> "C:\IT\VM-Backup.log"

IF %SRV% EQU 0 goto END

SET /A SRV=%SRV%+1

goto %SRV%



:ERR0

IF %SRV% EQU 0 goto END

SET /A SRV=%SRV%+1

goto %SRV%



:END

net use /del v: /y

exit

Rename all files in a folder with specific extension

 
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set FileList = objWMIService.ExecQuery _
    ("ASSOCIATORS OF {Win32_Directory.Name='C:\test'} Where " _
        & "ResultClass = CIM_DataFile")

For Each objFile In FileList
    strDate = Left(objFile.CreationDate, 8)
    strNewName = objFile.Drive & objFile.Path & _
       strDate & "." & "jpg"
    strNameCheck = Replace(strNewName, "\", "\\")

    i = 1
    Do While True
        Set colFiles = objWMIService.ExecQuery _
            ("Select * from Cim_Datafile Where Name = '" & strNameCheck & "'")
        If colFiles.Count = 0 Then
            errResult = objFile.Rename(strNewName)
            Exit Do
        Else
            i = i + 1
            strNewName = objFile.Drive & objFile.Path & _
                strDate & "" & i & "." & "jpg"
            strNameCheck = Replace(strNewName, "\", "\\")
        End If
    Loop
Next

Lock your workstation

 Batch file to lock the screen of your PC. Tested on Windows XP, Vista and 7. Works!

@echo off
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
exit
Or

Right click an empty area of your desktop, choose New/Shortcut and enter this line as the command line:
rundll32.exe user32.dll, LockWorkStation 

Or

Windows + L

User Profile Copier

A script to copy the user profile from one PC to another PC / USB drive.
You must make sure you first logon / logoff the required user on the destination PC and then logon with a domain admin to run the script as it requires access to copy to a c$ share.
This script makes it much easier to copy user profiles between machines.
 
@ECHO OFF

REM  User Profile Copier Script
REM  
REM  REM  Will copy Desktop items, Outlook PST files, 
REM  Outlook NK2 (Auto-complete) files, Outlook 
REM  Signatures, IE Favourites and anything in the
REM  the local My Documents folder

TITLE User Profile Copier

REM Change colour - because it's prettier and I'm a Leicester fan!
color 1F

cls
echo.
REM Get required details for profile copy
set /p SourcePC=Please enter the Computer Name of the source PC or type 0 for this PC: 
echo.
echo Please enter either the destination Computer Name or the destination 
set /p Destination=USB drive letter (eg. E:) To copy to the local PC type "C:" 
echo.
REM Ascertain media
set /p Media=Is this a USB or local C: (D)rive or is it a destination (P)C? 
echo.
set /p user=Please enter the Username for the user you wish to copy: 
REM Set filename for copy log as profilecopy-USERNAME-DATE.txt
set ProfFile=profilecopy-%user%-%date:~-11,2%%date:~-7,2%%date:~-2,2%.txt
echo.

TITLE User Profile Copier - %user%
cls

echo.
REM Output message to CMD window
echo The script is now running, please wait...

REM Begin witing logfile, note initially everything is written to the root of the local c: drive
echo Profile Copy > c:\%ProfFile%
echo ---------------- >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Date:        %date% >> c:\%ProfFile%
echo Time:        %time:~-11,5% >> c:\%ProfFile%
echo. >> c:\%ProfFile%
if /i %sourcepc% EQU 0  echo Source:      %computername% >> c:\%ProfFile%
if /i %sourcepc% NEQ 0  echo Source:      %sourcepc% >> c:\%ProfFile%
echo Destination: %destination% >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Username:    %user% >> c:\%ProfFile%
echo. >> c:\%ProfFile%

REM If copying to USB / local disk set destination accordingly
if /i %media% EQU D set dest=%destination%\Documents and Settings\%user%
if /i %media% NEQ P goto CheckSource
REM If copying to network PC set location accordingly
set dest=\\%destination%\c$\documents and settings\%user%
if not exist "%dest%" goto DestError

:CheckSource
echo Begin Copy >> c:\%ProfFile%
echo ---------------- >> c:\%ProfFile%
echo. >> c:\%ProfFile%
REM If source is local PC run different routine
if /i %sourcepc% EQU 0 goto NoSource

REM Set source location as remote machine
set source=\\%sourcepc%\c$\documents and settings\%user%
echo Copying Outlook NK2 (Auto-complete files)... >> c:\%ProfFile%
REM Copy Outlook NK2 files from source to destination
xcopy "%source%\Application Data\Microsoft\Outlook\*.nk2" "%dest%\Application Data\Microsoft\Outlook\*.nk2" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%

REM If there is an error with the copy goto an error routine
if %ERRORLEVEL% EQU 1 goto DestError
if %ERRORLEVEL% EQU 4 goto SourceError

echo Copying desktop items... >> c:\%ProfFile%
REM Copy desktop items from source to destination
xcopy "%source%\Desktop\*" "%dest%\Desktop\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying Outlook PST files... >> c:\%ProfFile%
REM Copy PST files from source to destination (only in folder Local Settings\App Data\Microsoft\Outlook\
xcopy "%source%\Local Settings\Application Data\Microsoft\Outlook\*.pst" "%dest%\Local Settings\Application Data\Microsoft\Outlook\*.pst" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying Outlook Signatures... >> c:\%ProfFile%
REM Copy Outlook Signatures from source to destination
xcopy "%source%\Application Data\Microsoft\Signatures\*" "%dest%\Application Data\Microsoft\Signatures\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying IE Favourites... >> c:\%ProfFile%
REM Copy IE Favourites from source to destination
xcopy "%source%\Favorites\*" "%dest%\Favorites\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying My Documents folder... >> c:\%ProfFile%
REM Copy My Documents folder from source to destination
if exist "%source%\My Documents" xcopy "%source%\My Documents\*" "%dest%\My Documents\*" /s /y >> c:\%ProfFile%
if exist "%source%\%user%'s Documents" xcopy "%source%\%user%'s Documents" "%dest%\My Documents\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
goto Complete

:NoSource
REM Set source location as...
set source=c:\documents and settings\%user%

echo Copying Outlook NK2 (Auto-complete files)... >> c:\%ProfFile%
REM Copy Outlook NK2 files from source to destination
xcopy "%source%\Application Data\Microsoft\Outlook\*.nk2" "%dest%\Application Data\Microsoft\Outlook\*.nk2" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%

REM If there is an error with the copy goto an error routine
if %ERRORLEVEL% EQU 1 goto DestError
if %ERRORLEVEL% EQU 4 goto SourceError

echo Copying desktop items... >> c:\%ProfFile%
REM Copy desktop items from source to destination
xcopy "%source%\Desktop\*" "%dest%\Desktop\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying Outlook PST files... >> c:\%ProfFile%
REM Copy PST files from source to destination (only in folder Local Settings\App Data\Microsoft\Outlook\
xcopy "%source%\Local Settings\Application Data\Microsoft\Outlook\*.pst" "%dest%\Local Settings\Application Data\Microsoft\Outlook\*.pst" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying Outlook Signatures... >> c:\%ProfFile%
REM Copy Outlook Signatures from source to destination
xcopy "%source%\Application Data\Microsoft\Signatures\*" "%dest%\Application Data\Microsoft\Signatures\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying IE Favourites... >> c:\%ProfFile%
REM Copy IE Favourites from source to destination
xcopy "%source%\Favorites\*" "%dest%\Favorites\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
echo Copying My Documents folder... >> c:\%ProfFile%
REM Copy My Documents folder from source to destination
if exist "%source%\My Documents" xcopy "%source%\My Documents\*" "%dest%\My Documents\*" /s /y >> c:\%ProfFile%
if exist "%source%\%user%'s Documents" xcopy "%source%\%user%'s Documents" "%dest%\My Documents\*" /s /y >> c:\%ProfFile%
echo. >> c:\%ProfFile%
goto Complete

:DestError
REM DestError will trigger when there is an issue getting files to a destination PC
cls
echo Either the access rights are not set correctly or the user does not yet exist 
echo on the destination PC.
echo Either the access rights are not set correctly or the user does not yet exist on the destination PC. >> c:\%ProfFile%
echo.
echo This script will now close.
goto End

:SourceError
REM SourceError will trigger when there is an issue getting files from a source PC
cls
echo The source files cannot be found, please make sure the username and source 
echo computer name are correct.
echo The source files cannot be found, please make sure the username and source computer name are correct. >> c:\%ProfFile%
echo.
echo This script will now close.
goto End

:Complete
cls
echo The script completed successfully, the files are now copied to: 
echo %dest%\
echo. >> c:\%ProfFile%
echo The script completed successfully, the files are now copied to %dest%\ >> c:\%ProfFile%

REM Move logfile to destination
move /y c:\%ProfFile% "%dest%\%ProfFile%"

:End
REM If a copy errors out the logfile will remain on the root of the c: drive
echo.
pause

Quick backup and restore of your NK2 file

To back it up.bat
md \\yourserver1\nk2\%username%
copy “c:\Documents and Settings\%username%\application data\Microsoft\Outlook\*.Nk2″  \\yourserver\nk2\%username%

To restore it.bat.bat
copy \\yourserver1\nk2\%username%\*.nk2 “c:\Documents and Settings\%username%\application data\Microsoft\Outlook\”