Process Building Blocks and Custom Resources in batches

You can process Building Blocks and Custom Resources in batches from the Workspace Control Console (pwrtech.exe).

Command-line parameters for pwrtech.exe

pwrtech.exe /del <buildingblock file>

Any object that is in the specified Building Block (<buildingblock file>) will be deleted.

  • Specify the full path to the Building Block for <buildingblock file>

pwrtech.exe /del /guid={objectguid}

Delete the object with the GUID as specified between {...}.

pwrtech.exe /export <filepath> [/type=(type1,type2....) | /guid={objectguid} ]

Create Building Block with limited number of features.

  • Specify the specific feature(s) (Type(s)) that need to be included in the Building Block for /type. The list with the different Types can be found below.
    • Separate different Types with a comma (",").
    • If no Types are specified, a Building Block for the entire environment will be created.

Examples:
pwrtech.exe /export C:\temp\bb.xml /type=printer -> the Building Block bb.xml will be created in C:\temp and will only include data from Type PRINTER.

pwrtech.exe /export C:\temp\printer_mapping.xml /type=printer,mapping -> Building Block with only data of Types PRINTER and MAPPING will be created.

  • Use /guid, to create a Building Block for one specific object. Object GUIDS can be found in the Datastore.

pwrtech.exe /addresource <resourcefile> /path=Ivanti\Workspace Control [/guid={guid}]

Add a resource file as a Custom Resource in the specified location.

  • For <resourcefile>, specify the resource file that needs to be added to the Workspace Control environment (full path).
  • For /path, specify the location (full path) where the resource file must be added in the Console (at Administration > Custom Resources).
    • If no path is specified, the resource file will be added as a Custom Resource to the root folder at Administration > Custom Resources.
    • If the specified path does not exist, a new folder will be created in the folder tree at Administration > Custom Resources and the resource file will be added to that folder as a Custom Resource.

Example:

pwrtech.exe /addresource C:\temp\mine.ico /path=\mycustomresources\subfolder -> The resource file mine.ico will be added as a Custom Resource in "sub-folder" at Administration > Custom Resources in the MyCustomResources folder.

  • Giving a value for /guid is optional. /guid can be used to overwrite an existing Custom Resource.

pwrtech.exe /exportresource /target=<file> [/path=Ivanti\Workspace Control | /guid={guid}]

Export a Custom Resource from Workspace Control and place it in the specified location.

  • For /target, specify the resource file name and full path the Custom Resource must be exported to.
  • For /path, specify the full path to the Custom Resource in the Console.
    • If only a file name is specified, pwrtech.exe will try to extract the Custom Resource from the root folder at Administration > Custom Resources.
  • Specify a value for /guid to extract the Custom Resource with that guid.
  • Important: Either /path or /guid may be used, not both.

Example:

pwrtech.exe /exportresource /target=C:\temp\dummy.ico /path=mine.ico -> the Custom Resource mine.ico will be extracted from the root folder at Administration > Custom Resources in the Console and be placed as the resource file dummy.ico at C:\temp\.

pwrtech.exe /delresource [/path=Ivanti\Workspace Control | /guid={guid}]

Delete a Custom Resource file from Workspace Control.

  • For /path, specify the full path to the Custom Resource file in the Console.
    • If only a file name is specified, pwrtech.exe will try to remove the Custom Resource from the root folder at Administration > Custom Resources.
  • Specify a value for /guid to remove the Custom Resource with that guid.
  • Important: Either /path or /guid may be used, not both.

The following Types can be used with /type in the Command line for pwrtech.exe /export:

Type

Feature in Management Console

APPLICATION

Composition > Applications

AUTOMATIONTASK

Composition > Actions By Type > Automation Tasks

CONFIGMGR

Composition > Actions By Type > Microsoft ConfigMgr

DATASOURCE

Composition > Applications > Data Sources

DIRECTORYSERVICE

User Context > Directory Services

EMAIL

Composition > Applications > E-mail Settings

EXECUTECOMMAND

Composition > Actions By Type > Execute Command

FOLDERREDIRECTION

Composition > Actions By Type > Files and Folders > Folder Redirection

FOLDERSYNC

Composition > Actions By Type > Files and Folders > Folder Synchronization

HOMEDIRECTORY

Composition > Actions By Type > Files and Folders > User Home Directory

LOCATION

User Context > Locations and Devices

MAPPING

Composition > Actions By Type > Files and Folders > Drive and Port Mappings

PRINTER

Composition > Actions By Type > Printers

PROFILEDIRECTORY

Composition > Actions By Type > Files and Folders > User Profile Directory

REGISTRY

Composition > Actions By Type > User Registry

SUBSTITUTE

Composition > Actions By Type > Files and Folders > Drive Substitutes

USERSETTING

Composition > User Settings

VARIABLE

Composition > Actions By Type > Environment Variables

To facilitate these batch scripts, the following error levels are available and will be returned in %errorlevel%:

Error level

Description

0

The command line was executed successfully.

1

The file was not specified in the command line.

2

The file was not a valid XML file.

3

The object was not found in the Datastore.

4

Saving the Custom Resource in the Datastore failed.

5

Deleting the object or Custom Resource failed.

6

The /guid has an invalid guid specified.

7

The object specified with /guid does not exist.

8

The Custom Resource specified with /guid does not exist.

9

Insufficient rights, the caller belongs to an administrative role which does not have modify permissions for the object type or Custom Resources.

10

Required command-line options not specified.

11

The path specified for /path does not exist.

12

Importing a Building Block via the command line with /passwordfips failed, because the file name contains a wildcard (* or ? or |).

14

Importing a Building Block via the command line failed, because no /passwordfips is provided or the password is incorrect.