Batch File Command
The batch file command is designed to execute multiple commands using a single command.
Required Arguments
-operation BatchFile
-filepath "C:\temp\test.txt"
Example
-operation BatchFile -filepath "C:\temp\batchfile.txt"
Example: Batch File
A batch file containing multiple commands, one command per line.
Important
The MacroView Provisioner console app uses specific file system directories at runtime in order to generate and output files. Therefore, concurrent processing is not supported. Only run one instance of MacroView Provisioner at any one time.
Batch files can be used to execute hundreds of commands by running a single command.
It is not recommended to provision thousands of items in a single batch file.
Provisioning also has to happen following a top-down sequence, create the site collections first, then add the solution to each site collection, next create the sites and finally create the libraries.
For example, create 3-4 site collections, then add solutions to each site collection, then create the sites and so on. Once the end-to-end process has been run and the outcome validated, then scale as required.
Recommended Batch File Size
The recommended batch file size:
- Create Site Collection (5-10 at a time).
- Add Solution (10-20 at a time).
- Create Site (100-500 at a time).
- Create Library (100-500 at a time).
Processing Times
Processing times can vary depending on the environment and performance of the SharePoint farm.
For Office 365 provisioning times and outcomes can vary on a daily basis. It is recommended to start with small to medium batch size and then scale batch size based on successful batch runs and desired timeframes.
Use ConsoleCommands.xlsx to create a batch file
Please use the provided Excel spreadsheet ConsoleCommands.xlsx to a create a batch file.
The spreadsheet contains tabs, one for each type of command.
The most commonly used tabs are:
- Batch
- Create Site Collection
- Add Solution (used to add site columns and content types to existing site collections)
- Create Site (in existing site collections)
- Create Library (in existing site collections and sites)
Lets create 20 sites in an existing site collection
Open the ConsoleCommands.xlsx spreadsheet and go to the Create Site tab.
Enter the values into the provided columns and use the drag technique to replicate the provided Batch File Command column cell formula to all the required rows.
Next, select the Batch File Command column and copy / paste the commands into a text file (i.e. batchfile.txt) to create a batch file.
Important
Save the text file, give it a name and most importantly set the encoding to be UTF-8.
Execute the Batch File
The text file can then be specified as input for the console command.
Step 1
Run > Command Prompt
or
Run a command prompt using the Windows Start button and search for Command Prompt (CMD)
Step 2
cd "C:\Program Files\MacroView\MVSP\Standalone"
Step 3
Use the ConsoleCommand.xlsx spreadsheet to author a batch file command.
Open the spreadsheet and go to the Execute Batch File tab.
Fill in the provided columns and copy / paste the Batch File Command to the command prompt window.
C:\Program Files\MacroView\MVSP\Standalone>MacroView.Solutions.Provisioning.Console.exe -operation BatchFile -filepath "C:\temp\batchfile.txt"
C:\ProgramFiles\MacroView\MVSP\Standalone> MacroView.Solutions.Provisioning.Console.exe -operation BatchFile -filepath "C:\temp\batchfile.txt"
Result (batch file run)
Note
The results of a batch file run are written to a CSV file.
The output and statistics displayed above are written to the log file.
We also support batch files that contain a mix of different commands
Below is a sample text file containing a mix of different commands.
Note
It is the responsibility of the user creating the batch file to ensure that entries are ordered such that the pre-requisite areas are created first.
For example: a site collection is created first, followed by sub-sites, then libraries.
Continue to Part 9 - Excel File Command