Scripting – Back up PST file

 Option Explicit Const OverwriteExisting = True Dim objWMIService Dim objFileOut Dim objTextFile Dim strDriveName Dim WshNetwork Dim strUserName Dim colDisks Dim objDisk Dim strDate Dim colItems Dim objItems Dim PST_array(500) Dim PST_i_counter Dim k Dim strFolderName Dim arrFolderPath Dim strNewPath Dim i Dim objFSO Dim objFolder Dim FileWritePath Dim DocumentationFile Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2”) PST_i_counter = 0 ‘Gets current username Set WshNetwork =...

read more

Scripting – Exchange mailbox size and number of messages

 ‘This script logs on to a server that is running Exchange Server and ‘displays the current number of bytes that are used in the user’s ‘mailbox and the number of messages. ‘ USAGE: cscript MailboxSize.vbs SERVERNAME MAILBOXNAME ‘ This requires that CDO 1.21 is installed on the computer. ‘ This script is provided AS IS. It is intended as a SAMPLE only. ‘ Microsoft offers no warranty or support for this script. ‘ Use at your own risk. ‘ Get command line arguments. Dim obArgs Dim...

read more

Scripting – Find FISMO roles

 Option Explicit Dim WSHNetwork, objArgs, ADOconnObj, bstrADOQueryString, RootDom, RSObj Dim FSMOobj,CompNTDS, Computer, Path, HelpText Set WSHNetwork = CreateObject(“WScript.Network”) Set objArgs = WScript.Arguments HelpText = “This script will find the FSMO role owners for your domain.” & Chr(13) &_ Chr(10) & “The syntax is as follows:” & Chr(13) & Chr(10) &_ “find_fsmo DC=MYDOM,DC=COM” & Chr(13) & Chr(10) &_ “””Where MYDOM.COM is your...

read more

LDIFDE – Export Users

 ldifde -f Users.txt -s adserver -d “OU=Misc Users, dc=crimsonshift, dc=com” -r “(& (objectCategory=person)(objectClass=User)(givenname=*))” -o “dn, changetype” -l “sn, givenName, title, telephoneNumber, mail”

read more

SCVDE – Export Users

 csvde -f Users.txt -s adserver -d “OU=Misc Users, dc=crimsonshift, dc=com” -r “(& (objectCategory=person)(objectClass=User)(givenname=*))” -o “dn, changetype” -l “sn, givenName, title, telephoneNumber, mail”

read more

Scripting – Disabled Active Directory (AD) users

 On Error Resume Next Dim objTextFile, Path Path = InputBox(“Enter your DC name or the DN for your domain”&_ ” dc=crimsonshift,dc=com’:”,”Enter path”) Set objConnection = CreateObject(“ADODB.Connection”) Set objCommand =   CreateObject(“ADODB.Command”) objConnection.Provider = “ADsDSOObject” objConnection.Open “Active Directory Provider” Set objCommand.ActiveConnection = objConnection Set objFSO =...

read more